OpenAvnu  0.1
igb_main.c 파일 참조
#include <linux/module.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
#include <linux/netdevice.h>
#include <linux/tcp.h>
#include <linux/if_vlan.h>
#include <linux/if_bridge.h>
#include "igb.h"
#include "igb_vmdq.h"
igb_main.c에 대한 include 의존 그래프

이 파일의 소스 코드 페이지로 가기

매크로

#define DRV_DEBUG
 
#define DRV_HW_PERF
 
#define VERSION_SUFFIX   "_AVB"
 
#define MAJ   5
 
#define MIN   3
 
#define BUILD   2
 
#define DRV_VERSION
 
#define Q_IDX_82576(i)   (((i & 0x1) << 3) + (i >> 1))
 
#define IGB_N0_QUEUE   -1
 
#define E1000_MRQC_ENABLE_DEF_Q3   (3 << 3)
 
#define IGB_STAGGERED_QUEUE_OFFSET   8
 
#define IGB_SET_FLAG(_input, _flag, _result)
 
#define MAX_STD_JUMBO_FRAME_SIZE   9238
 
#define PHY_IDLE_ERROR_COUNT_MASK   0x00FF
 
#define TX_WAKE_THRESHOLD   (DESC_NEEDED * 2)
 
#define E1000_CTRL_EN_PHY_PWR_MGMT   0x00200000
 
#define E1000_DEV_ID_82576_VF   0x10CA
 

열거형 타입

enum  latency_range { lowest_latency = 0, low_latency = 1, bulk_latency = 2, latency_invalid = 255 }
 

함수

 MODULE_DEVICE_TABLE (pci, igb_pci_tbl)
 
static int igb_setup_all_tx_resources (struct igb_adapter *)
 
static int igb_setup_all_rx_resources (struct igb_adapter *)
 
static void igb_free_all_tx_resources (struct igb_adapter *)
 
static void igb_free_all_rx_resources (struct igb_adapter *)
 
static void igb_setup_mrqc (struct igb_adapter *)
 
static int igb_probe (struct pci_dev *, const struct pci_device_id *)
 
static void igb_remove (struct pci_dev *pdev)
 
static int igb_sw_init (struct igb_adapter *)
 
static int igb_open (struct net_device *)
 
static int igb_close (struct net_device *)
 
static void igb_configure (struct igb_adapter *)
 
static void igb_configure_tx (struct igb_adapter *)
 
static void igb_configure_rx (struct igb_adapter *)
 
static void igb_clean_all_tx_rings (struct igb_adapter *)
 
static void igb_clean_all_rx_rings (struct igb_adapter *)
 
static void igb_clean_tx_ring (struct igb_ring *)
 
static void igb_set_rx_mode (struct net_device *)
 
static void igb_update_phy_info (struct timer_list *)
 
static void igb_watchdog (struct timer_list *)
 
static void igb_dma_err_timer (struct timer_list *)
 
static void igb_watchdog_task (struct work_struct *)
 
static void igb_dma_err_task (struct work_struct *)
 
static u16 igb_select_queue (struct net_device *dev, struct sk_buff *skb, void *accel_priv, select_queue_fallback_t fallback)
 
static netdev_tx_t igb_xmit_frame (struct sk_buff *skb, struct net_device *)
 
static struct net_device_stats * igb_get_stats (struct net_device *)
 
static int igb_change_mtu (struct net_device *, int)
 
static int igb_set_mac (struct net_device *, void *)
 
static void igb_set_uta (struct igb_adapter *adapter)
 
static irqreturn_t igb_intr (int irq, void *)
 
static irqreturn_t igb_intr_msi (int irq, void *)
 
static irqreturn_t igb_msix_other (int irq, void *)
 
static void igb_rar_set_qsel (struct igb_adapter *, u8 *, u32, u8)
 
static irqreturn_t igb_msix_ring (int irq, void *)
 
static int igb_poll (struct napi_struct *, int)
 
static bool igb_clean_tx_irq (struct igb_q_vector *)
 
static bool igb_clean_rx_irq (struct igb_q_vector *, int)
 
static int igb_ioctl (struct net_device *, struct ifreq *, int cmd)
 
static void igb_tx_timeout (struct net_device *)
 
static void igb_reset_task (struct work_struct *)
 
static int igb_vlan_rx_add_vid (struct net_device *, u16)
 
static int igb_vlan_rx_kill_vid (struct net_device *, u16)
 
static void igb_restore_vlan (struct igb_adapter *)
 
static void igb_ping_all_vfs (struct igb_adapter *)
 
static void igb_msg_task (struct igb_adapter *)
 
static void igb_vmm_control (struct igb_adapter *)
 
static int igb_set_vf_mac (struct igb_adapter *, int, unsigned char *)
 
static void igb_restore_vf_multicasts (struct igb_adapter *adapter)
 
static void igb_process_mdd_event (struct igb_adapter *)
 
static int igb_vf_configure (struct igb_adapter *adapter, int vf)
 
static int igb_init_avb (struct e1000_hw *hw)
 
static int igb_open_file (struct inode *inode, struct file *file)
 
static int igb_close_file (struct inode *inode, struct file *file)
 
static long igb_ioctl_file (struct file *file, unsigned int cmd, unsigned long arg)
 
static void igb_vm_open (struct vm_area_struct *vma)
 
static void igb_vm_close (struct vm_area_struct *vma)
 
static int igb_vm_fault (struct vm_fault *fdata)
 
static int igb_mmap (struct file *file, struct vm_area_struct *vma)
 
static ssize_t igb_read (struct file *file, char __user *buf, size_t count, loff_t *pos)
 
static ssize_t igb_write (struct file *file, const char __user *buf, size_t count, loff_t *pos)
 
static unsigned int igb_pollfd (struct file *file, poll_table *wait)
 
static void igb_shutdown (struct pci_dev *)
 
static pci_ers_result_t igb_io_error_detected (struct pci_dev *, pci_channel_state_t)
 
static pci_ers_result_t igb_io_slot_reset (struct pci_dev *)
 
static void igb_io_resume (struct pci_dev *)
 
static void igb_init_fw (struct igb_adapter *adapter)
 
static void igb_init_dmac (struct igb_adapter *adapter, u32 pba)
 
 MODULE_AUTHOR ("Intel Corporation, <e1000-devel@lists.sourceforge.net>")
 
 MODULE_DESCRIPTION ("Intel(R) Gigabit Ethernet Network Driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (DRV_VERSION)
 
static void igb_vfta_set (struct igb_adapter *adapter, u32 vid, bool add)
 
 module_param (debug, int, 0)
 
 MODULE_PARM_DESC (debug,"Debug level (0=none, ..., 16=all)")
 
 module_param (tx_size, int, 0)
 
 MODULE_PARM_DESC (tx_size,"Tx Ring size passed in insmod parameter")
 
static int __init igb_init_module (void)
 
 module_init (igb_init_module)
 
static void __exit igb_exit_module (void)
 
 module_exit (igb_exit_module)
 
static void igb_cache_ring_register (struct igb_adapter *adapter)
 
u32 e1000_read_reg (struct e1000_hw *hw, u32 reg)
 
static void igb_configure_lli (struct igb_adapter *adapter)
 
static void igb_write_ivar (struct e1000_hw *hw, int msix_vector, int index, int offset)
 
static void igb_assign_vector (struct igb_q_vector *q_vector, int msix_vector)
 
static void igb_configure_msix (struct igb_adapter *adapter)
 
static int igb_request_msix (struct igb_adapter *adapter)
 
static void igb_free_q_vector (struct igb_adapter *adapter, int v_idx)
 
static void igb_reset_q_vector (struct igb_adapter *adapter, int v_idx)
 
static void igb_reset_interrupt_capability (struct igb_adapter *adapter)
 
static void igb_free_q_vectors (struct igb_adapter *adapter)
 
static void igb_clear_interrupt_scheme (struct igb_adapter *adapter)
 
static void igb_disable_mdd (struct igb_adapter *adapter)
 
static void igb_enable_mdd (struct igb_adapter *adapter)
 
static void igb_reset_sriov_capability (struct igb_adapter *adapter)
 
static void igb_set_sriov_capability (struct igb_adapter *adapter)
 
static void igb_set_interrupt_capability (struct igb_adapter *adapter, bool msix)
 
static void igb_add_ring (struct igb_ring *ring, struct igb_ring_container *head)
 
static int igb_alloc_q_vector (struct igb_adapter *adapter, unsigned int v_count, unsigned int v_idx, unsigned int txr_count, unsigned int txr_idx, unsigned int rxr_count, unsigned int rxr_idx)
 
static int igb_alloc_q_vectors (struct igb_adapter *adapter)
 
static int igb_init_interrupt_scheme (struct igb_adapter *adapter, bool msix)
 
static int igb_request_irq (struct igb_adapter *adapter)
 
static void igb_free_irq (struct igb_adapter *adapter)
 
static void igb_irq_disable (struct igb_adapter *adapter)
 
static void igb_irq_enable (struct igb_adapter *adapter)
 
static void igb_update_mng_vlan (struct igb_adapter *adapter)
 
static void igb_release_hw_control (struct igb_adapter *adapter)
 
static void igb_get_hw_control (struct igb_adapter *adapter)
 
void igb_power_up_link (struct igb_adapter *adapter)
 
static void igb_power_down_link (struct igb_adapter *adapter)
 
static void igb_check_swap_media (struct igb_adapter *adapter)
 
void igb_up (struct igb_adapter *adapter)
 
void igb_down (struct igb_adapter *adapter)
 
void igb_reinit_locked (struct igb_adapter *adapter)
 
void igb_enable_mas (struct igb_adapter *adapter)
 
void igb_reset (struct igb_adapter *adapter)
 
static netdev_features_t igb_fix_features (struct net_device *netdev, netdev_features_t features)
 
static int igb_set_features (struct net_device *netdev, netdev_features_t features)
 
static int igb_ndo_fdb_add (struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, const unsigned char *addr, u16 vid, u16 flags)
 
static int igb_ndo_bridge_setlink (struct net_device *dev, struct nlmsghdr *nlh, u16 flags)
 
static int igb_ndo_bridge_getlink (struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev, u32 filter_mask, int nlflags)
 
static void igb_set_fw_version (struct igb_adapter *adapter)
 
static void igb_init_mas (struct igb_adapter *adapter)
 
void igb_rar_set (struct igb_adapter *adapter, u32 index)
 
static int __igb_open (struct net_device *netdev, bool resuming)
 
static int __igb_close (struct net_device *netdev, bool suspending)
 
int igb_setup_tx_resources (struct igb_ring *tx_ring)
 
void igb_setup_tctl (struct igb_adapter *adapter)
 
static u32 igb_tx_wthresh (struct igb_adapter *adapter)
 
void igb_configure_tx_ring (struct igb_adapter *adapter, struct igb_ring *ring)
 
int igb_setup_rx_resources (struct igb_ring *rx_ring)
 
void igb_setup_rctl (struct igb_adapter *adapter)
 
static int igb_set_vf_rlpml (struct igb_adapter *adapter, int size, int vfn)
 
static void igb_rlpml_set (struct igb_adapter *adapter)
 
static void igb_set_vf_vlan_strip (struct igb_adapter *adapter, int vfn, bool enable)
 
static void igb_set_vmolr (struct igb_adapter *adapter, int vfn, bool aupe)
 
void igb_configure_rx_ring (struct igb_adapter *adapter, struct igb_ring *ring)
 
void igb_free_tx_resources (struct igb_ring *tx_ring)
 
void igb_unmap_and_free_tx_resource (struct igb_ring *ring, struct igb_tx_buffer *tx_buffer)
 
void igb_free_rx_resources (struct igb_ring *rx_ring)
 
void igb_clean_rx_ring (struct igb_ring *rx_ring)
 
int igb_write_mc_addr_list (struct net_device *netdev)
 
void igb_full_sync_mac_table (struct igb_adapter *adapter)
 
void igb_sync_mac_table (struct igb_adapter *adapter)
 
int igb_available_rars (struct igb_adapter *adapter)
 
static int igb_write_uc_addr_list (struct net_device *netdev)
 
static void igb_check_wvbr (struct igb_adapter *adapter)
 
static void igb_spoof_check (struct igb_adapter *adapter)
 
bool igb_has_link (struct igb_adapter *adapter)
 
static void igb_update_ring_itr (struct igb_q_vector *q_vector)
 
static void igb_update_itr (struct igb_q_vector *q_vector, struct igb_ring_container *ring_container)
 
static void igb_set_itr (struct igb_q_vector *q_vector)
 
void igb_tx_ctxtdesc (struct igb_ring *tx_ring, u32 vlan_macip_lens, u32 type_tucmd, u32 mss_l4len_idx)
 
static int igb_tso (struct igb_ring *tx_ring, struct igb_tx_buffer *first, u8 *hdr_len)
 
static void igb_tx_csum (struct igb_ring *tx_ring, struct igb_tx_buffer *first)
 
static u32 igb_tx_cmd_type (struct sk_buff *skb, u32 tx_flags)
 
static void igb_tx_olinfo_status (struct igb_ring *tx_ring, union e1000_adv_tx_desc *tx_desc, u32 tx_flags, unsigned int paylen)
 
static void igb_tx_map (struct igb_ring *tx_ring, struct igb_tx_buffer *first, const u8 hdr_len)
 
static int __igb_maybe_stop_tx (struct igb_ring *tx_ring, const u16 size)
 
static int igb_maybe_stop_tx (struct igb_ring *tx_ring, const u16 size)
 
netdev_tx_t igb_xmit_frame_ring (struct sk_buff *skb, struct igb_ring *tx_ring)
 
static struct igb_ringigb_tx_queue_mapping (struct igb_adapter *adapter, struct sk_buff *skb)
 
void igb_update_stats (struct igb_adapter *adapter)
 
static void igb_tsync_interrupt (struct igb_adapter *adapter)
 
static void igb_write_itr (struct igb_q_vector *q_vector)
 
void igb_mta_set (struct igb_adapter *adapter, u32 hash_value)
 
static int igb_set_vf_promisc (struct igb_adapter *adapter, u32 *msgbuf, u32 vf)
 
static int igb_set_vf_multicasts (struct igb_adapter *adapter, u32 *msgbuf, u32 vf)
 
static void igb_clear_vf_vfta (struct igb_adapter *adapter, u32 vf)
 
s32 igb_vlvf_set (struct igb_adapter *adapter, u32 vid, bool add, u32 vf)
 
static int igb_find_vlvf_entry (struct igb_adapter *adapter, int vid)
 
static int igb_set_vf_vlan (struct igb_adapter *adapter, u32 *msgbuf, u32 vf)
 
static void igb_vf_reset (struct igb_adapter *adapter, u32 vf)
 
static void igb_vf_reset_event (struct igb_adapter *adapter, u32 vf)
 
static void igb_vf_reset_msg (struct igb_adapter *adapter, u32 vf)
 
static int igb_set_vf_mac_addr (struct igb_adapter *adapter, u32 *msg, int vf)
 
static void igb_rcv_ack_from_vf (struct igb_adapter *adapter, u32 vf)
 
static void igb_rcv_msg_from_vf (struct igb_adapter *adapter, u32 vf)
 
void igb_ring_irq_enable (struct igb_q_vector *q_vector)
 
static void igb_reuse_rx_page (struct igb_ring *rx_ring, struct igb_rx_buffer *old_buff)
 
static bool igb_can_reuse_rx_page (struct igb_rx_buffer *rx_buffer, struct page *page, unsigned int truesize)
 
static bool igb_add_rx_frag (struct igb_ring *rx_ring, struct igb_rx_buffer *rx_buffer, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb)
 
static struct sk_buff * igb_fetch_rx_buffer (struct igb_ring *rx_ring, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb)
 
static void igb_rx_checksum (struct igb_ring *ring, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb)
 
static bool igb_can_lro (struct igb_ring *rx_ring, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb)
 
static struct igb_lrohdrigb_lro_hdr (struct sk_buff *skb)
 
static void igb_lro_flush (struct igb_q_vector *q_vector, struct sk_buff *skb)
 
static void igb_lro_flush_all (struct igb_q_vector *q_vector)
 
static void igb_lro_header_ok (struct sk_buff *skb)
 
static void igb_merge_frags (struct sk_buff *lro_skb, struct sk_buff *new_skb)
 
static void igb_lro_receive (struct igb_q_vector *q_vector, struct sk_buff *new_skb)
 
static void igb_process_skb_fields (struct igb_ring *rx_ring, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb)
 
static bool igb_is_non_eop (struct igb_ring *rx_ring, union e1000_adv_rx_desc *rx_desc)
 
static unsigned int igb_get_headlen (unsigned char *data, unsigned int max_len)
 
static void igb_pull_tail (struct igb_ring *rx_ring, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb)
 
static bool igb_cleanup_headers (struct igb_ring *rx_ring, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb)
 
static bool igb_alloc_mapped_page (struct igb_ring *rx_ring, struct igb_rx_buffer *bi)
 
void igb_alloc_rx_buffers (struct igb_ring *rx_ring, u16 cleaned_count)
 
void e1000_read_pci_cfg (struct e1000_hw *hw, u32 reg, u16 *value)
 
void e1000_write_pci_cfg (struct e1000_hw *hw, u32 reg, u16 *value)
 
s32 e1000_read_pcie_cap_reg (struct e1000_hw *hw, u32 reg, u16 *value)
 
s32 e1000_write_pcie_cap_reg (struct e1000_hw *hw, u32 reg, u16 *value)
 
void igb_vlan_mode (struct net_device *netdev, u32 features)
 
int igb_set_spd_dplx (struct igb_adapter *adapter, u16 spddplx)
 
int igb_setup_queues (struct igb_adapter *adapter)
 
static int __igb_shutdown (struct pci_dev *pdev, bool *enable_wake, bool runtime)
 
int igb_add_mac_filter (struct igb_adapter *adapter, u8 *addr, u16 queue)
 
int igb_del_mac_filter (struct igb_adapter *adapter, u8 *addr, u16 queue)
 
static int __igb_notify_lookup (struct device *dev, void *data)
 
static struct igb_adapterigb_lookup (char *id)
 
static int igb_bind (struct file *file, void __user *argp)
 
static int igb_unbind (struct file *file)
 
static long igb_getspeed (struct file *file, void __user *arg)
 
static long igb_mapbuf_user (struct file *file, void __user *arg, int ring)
 
static long igb_mapbuf (struct file *file, void __user *arg, int ring)
 
static long igb_unmapbuf (struct file *file, void __user *arg, int ring)
 

변수

char igb_driver_name [] = "igb_avb"
 
char igb_driver_version [] = DRV_VERSION
 
static const char igb_driver_string []
 
static const char igb_copyright []
 
static const struct pci_device_id igb_pci_tbl []
 
static struct vm_operations_struct igb_mmap_ops
 
static struct pci_error_handlers igb_err_handler
 
static struct file_operations igb_fops
 
static struct miscdevice igb_miscdev
 
static struct pci_driver igb_driver
 
static int debug = NETIF_MSG_DRV | NETIF_MSG_PROBE
 
static int tx_size = 256
 
static const struct net_device_ops igb_netdev_ops
 

매크로 문서화

#define BUILD   2

igb_main.c 파일의 83 번째 라인에서 정의되었습니다.

#define DRV_DEBUG

igb_main.c 파일의 76 번째 라인에서 정의되었습니다.

#define DRV_HW_PERF

igb_main.c 파일의 78 번째 라인에서 정의되었습니다.

#define DRV_VERSION
값:
__stringify(MAJ) "." __stringify(MIN) "."\
#define DRV_HW_PERF
Definition: igb_main.c:78
#define MIN
Definition: igb_main.c:82
#define BUILD
Definition: igb_main.c:83
#define DRV_DEBUG
Definition: igb_main.c:76
#define VERSION_SUFFIX
Definition: igb_main.c:79
#define MAJ
Definition: igb_main.c:81

igb_main.c 파일의 84 번째 라인에서 정의되었습니다.

#define E1000_CTRL_EN_PHY_PWR_MGMT   0x00200000
#define E1000_DEV_ID_82576_VF   0x10CA

igb_main.c 파일의 9504 번째 라인에서 정의되었습니다.

#define E1000_MRQC_ENABLE_DEF_Q3   (3 << 3)
#define IGB_N0_QUEUE   -1

igb_main.c 파일의 554 번째 라인에서 정의되었습니다.

#define IGB_SET_FLAG (   _input,
  _flag,
  _result 
)
값:
((_flag <= _result) ? \
((u32)(_input & _flag) * (_result / _flag)) : \
((u32)(_input & _flag) / (_flag / _result)))
u_int32_t u32
Definition: e1000_osdep.h:50

igb_main.c 파일의 5433 번째 라인에서 정의되었습니다.

#define IGB_STAGGERED_QUEUE_OFFSET   8

igb_main.c 파일의 4656 번째 라인에서 정의되었습니다.

#define MAJ   5

igb_main.c 파일의 81 번째 라인에서 정의되었습니다.

#define MAX_STD_JUMBO_FRAME_SIZE   9238
#define MIN   3

igb_main.c 파일의 82 번째 라인에서 정의되었습니다.

#define PHY_IDLE_ERROR_COUNT_MASK   0x00FF
#define Q_IDX_82576 (   i)    (((i & 0x1) << 3) + (i >> 1))

igb_main.c 파일의 450 번째 라인에서 정의되었습니다.

#define TX_WAKE_THRESHOLD   (DESC_NEEDED * 2)
#define VERSION_SUFFIX   "_AVB"

igb_main.c 파일의 79 번째 라인에서 정의되었습니다.

열거형 타입 문서화

열거형 멤버
lowest_latency 
low_latency 
bulk_latency 
latency_invalid 

igb_main.c 파일의 5048 번째 라인에서 정의되었습니다.

5048  {
5049  lowest_latency = 0,
5050  low_latency = 1,
5051  bulk_latency = 2,
5052  latency_invalid = 255
5053 };

함수 문서화

static int __igb_close ( struct net_device *  netdev,
bool  suspending 
)
static

igb_close - Disables a network interface : network interface device structure

Returns 0, this is not allowed to fail

The close entry point is called when an interface is de-activated by the OS. The hardware is still under the driver's control, but needs to be disabled. A global MAC reset is issued to stop the hardware, and all transmit and receive resources are freed.

igb_main.c 파일의 3452 번째 라인에서 정의되었습니다.

3453 {
3454  struct igb_adapter *adapter = netdev_priv(netdev);
3455 #ifdef CONFIG_PM_RUNTIME
3456  struct pci_dev *pdev = adapter->pdev;
3457 #endif /* CONFIG_PM_RUNTIME */
3458 
3459  WARN_ON(test_bit(__IGB_RESETTING, &adapter->state));
3460 
3461 #ifdef CONFIG_PM_RUNTIME
3462  if (!suspending)
3463  pm_runtime_get_sync(&pdev->dev);
3464 #endif /* CONFIG_PM_RUNTIME */
3465 
3466  igb_down(adapter);
3467 
3468  igb_release_hw_control(adapter);
3469 
3470  igb_free_irq(adapter);
3471 
3472  if(!suspending || (system_state != SYSTEM_RUNNING)){
3473  igb_free_all_tx_resources(adapter);
3474  igb_free_all_rx_resources(adapter);
3475  }
3476 
3477 #ifdef CONFIG_PM_RUNTIME
3478  if (!suspending)
3479  pm_runtime_put_sync(&pdev->dev);
3480 #endif /* CONFIG_PM_RUNTIME */
3481 
3482  return 0;
3483 }
#define WARN_ON(x)
Definition: kcompat.h:259
void igb_down(struct igb_adapter *adapter)
Definition: igb_main.c:1875
struct net_device * netdev
Definition: igb.h:535
struct pci_dev * pdev
Definition: igb.h:582
static void igb_release_hw_control(struct igb_adapter *adapter)
Definition: igb_main.c:1544
static void igb_free_irq(struct igb_adapter *adapter)
Definition: igb_main.c:1419
static void igb_free_all_tx_resources(struct igb_adapter *)
Definition: igb_main.c:4164
unsigned long state
Definition: igb.h:537
static void igb_free_all_rx_resources(struct igb_adapter *)
Definition: igb_main.c:4266

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int __igb_maybe_stop_tx ( struct igb_ring tx_ring,
const u16  size 
)
static

igb_main.c 파일의 5611 번째 라인에서 정의되었습니다.

5612 {
5613  struct net_device *netdev = netdev_ring(tx_ring);
5614 
5615  if (netif_is_multiqueue(netdev))
5616  netif_stop_subqueue(netdev, ring_queue_index(tx_ring));
5617  else
5618  netif_stop_queue(netdev);
5619 
5620  /* Herbert's original patch had:
5621  * smp_mb__after_netif_stop_queue();
5622  * but since that doesn't exist yet, just open code it.
5623  */
5624  smp_mb();
5625 
5626  /* We need to check again in a case another CPU has just
5627  * made room available.
5628  */
5629  if (igb_desc_unused(tx_ring) < size)
5630  return -EBUSY;
5631 
5632  /* A reprieve! */
5633  if (netif_is_multiqueue(netdev))
5634  netif_wake_subqueue(netdev, ring_queue_index(tx_ring));
5635  else
5636  netif_wake_queue(netdev);
5637 
5638  tx_ring->tx_stats.restart_queue++;
5639 
5640  return 0;
5641 }
static u16 igb_desc_unused(const struct igb_ring *ring)
Definition: igb.h:481
u64 restart_queue
Definition: igb.h:333
#define netdev_ring(ring)
Definition: igb.h:469
int size
#define ring_queue_index(ring)
Definition: igb.h:470
struct igb_tx_queue_stats tx_stats
Definition: igb.h:391

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int __igb_notify_lookup ( struct device *  dev,
void *  data 
)
static

igb_main.c 파일의 10229 번째 라인에서 정의되었습니다.

10230 {
10231  struct net_device *netdev = dev_get_drvdata(dev);
10232  struct igb_adapter *adapter = netdev_priv(netdev);
10233  struct igb_pci_lookup *adapter_lookup = (struct igb_pci_lookup *)data;
10234 
10235  /* look at pci string - if its me, update the adapter pointer */
10236  printk("checking against adapter name %s\n", pci_name(adapter->pdev));
10237 
10238  if (!(strncmp(pci_name(adapter->pdev), adapter_lookup->pci_info,
10239  IGB_BIND_NAMESZ)))
10240  adapter_lookup->adapter = adapter;
10241 
10242  return E1000_SUCCESS;
10243 }
char * pci_info
Definition: igb.h:911
struct igb_adapter * adapter
Definition: igb.h:910
struct pci_dev * pdev
Definition: igb.h:582
#define IGB_BIND_NAMESZ
#define E1000_SUCCESS

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int __igb_open ( struct net_device *  netdev,
bool  resuming 
)
static

igb_open - Called when a network interface is made active : network interface device structure

Returns 0 on success, negative value on failure

The open entry point is called when a network interface is made active by the system (IFF_UP). At this point all resources needed for transmit and receive operations are allocated, the interrupt handler is registered with the OS, the watchdog timer is started, and the stack is notified that the interface is ready.

igb_main.c 파일의 3327 번째 라인에서 정의되었습니다.

3328 {
3329  struct igb_adapter *adapter = netdev_priv(netdev);
3330  struct e1000_hw *hw = &adapter->hw;
3331 #ifdef CONFIG_PM_RUNTIME
3332  struct pci_dev *pdev = adapter->pdev;
3333 #endif /* CONFIG_PM_RUNTIME */
3334  int err;
3335  int i;
3336 
3337  /* disallow open during test */
3338  if (test_bit(__IGB_TESTING, &adapter->state)) {
3339  WARN_ON(resuming);
3340  return -EBUSY;
3341  }
3342 
3343 #ifdef CONFIG_PM_RUNTIME
3344  if (!resuming)
3345  pm_runtime_get_sync(&pdev->dev);
3346 #endif /* CONFIG_PM_RUNTIME */
3347 
3348  netif_carrier_off(netdev);
3349 
3350  if(!resuming){
3351  /* allocate transmit descriptors */
3352  err = igb_setup_all_tx_resources(adapter);
3353  if (err)
3354  goto err_setup_tx;
3355 
3356  /* allocate receive descriptors */
3357  err = igb_setup_all_rx_resources(adapter);
3358  if (err)
3359  goto err_setup_rx;
3360  }
3361 
3362  igb_power_up_link(adapter);
3363 
3364  /* before we allocate an interrupt, we must be ready to handle it.
3365  * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt
3366  * as soon as we call pci_request_irq, so we have to setup our
3367  * clean_rx handler before we do so.
3368  */
3369  igb_configure(adapter);
3370 
3371  err = igb_request_irq(adapter);
3372  if (err)
3373  goto err_req_irq;
3374 
3375  /* Notify the stack of the actual queue counts. */
3376  netif_set_real_num_tx_queues(netdev,
3377  adapter->vmdq_pools ? 1 :
3378  adapter->num_tx_queues);
3379 
3380  err = netif_set_real_num_rx_queues(netdev,
3381  adapter->vmdq_pools ? 1 :
3382  adapter->num_rx_queues);
3383  if (err)
3384  goto err_set_queues;
3385 
3386  /* From here on the code is the same as igb_up() */
3387  clear_bit(__IGB_DOWN, &adapter->state);
3388 
3389  for (i = 0; i < adapter->num_q_vectors; i++)
3390  napi_enable(&(adapter->q_vector[i]->napi));
3391  igb_configure_lli(adapter);
3392 
3393  /* Clear any pending interrupts. */
3395 
3396  igb_irq_enable(adapter);
3397 
3398  /* notify VFs that reset has been completed */
3399  if (adapter->vfs_allocated_count) {
3400  u32 reg_data = E1000_READ_REG(hw, E1000_CTRL_EXT);
3401 
3402  reg_data |= E1000_CTRL_EXT_PFRSTD;
3403  E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg_data);
3404  }
3405 
3406  netif_tx_start_all_queues(netdev);
3407 
3408  if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA)
3409  schedule_work(&adapter->dma_err_task);
3410 
3411  /* start the watchdog. */
3412  hw->mac.get_link_status = 1;
3413  schedule_work(&adapter->watchdog_task);
3414 
3415  return E1000_SUCCESS;
3416 
3417 err_set_queues:
3418  igb_free_irq(adapter);
3419 err_req_irq:
3420  igb_release_hw_control(adapter);
3421  igb_power_down_link(adapter);
3422  igb_free_all_rx_resources(adapter);
3423 err_setup_rx:
3424  igb_free_all_tx_resources(adapter);
3425 err_setup_tx:
3426  igb_reset(adapter);
3427 
3428 #ifdef CONFIG_PM_RUNTIME
3429  if (!resuming)
3430  pm_runtime_put(&pdev->dev);
3431 #endif /* CONFIG_PM_RUNTIME */
3432 
3433  return err;
3434 }
unsigned int num_q_vectors
Definition: igb.h:540
struct e1000_hw hw
Definition: igb.h:594
#define WARN_ON(x)
Definition: kcompat.h:259
unsigned int vfs_allocated_count
Definition: igb.h:621
static void igb_power_down_link(struct igb_adapter *adapter)
Definition: igb_main.c:1634
int err
#define E1000_ICR
Definition: e1000_regs.h:55
#define E1000_CTRL_EXT
Definition: e1000_regs.h:32
struct net_device * netdev
Definition: igb.h:535
struct pci_dev * pdev
Definition: igb.h:582
static void igb_release_hw_control(struct igb_adapter *adapter)
Definition: igb_main.c:1544
static int igb_request_irq(struct igb_adapter *adapter)
Definition: igb_main.c:1371
unsigned int flags
Definition: igb.h:538
int num_tx_queues
Definition: igb.h:547
static void igb_free_irq(struct igb_adapter *adapter)
Definition: igb_main.c:1419
int num_rx_queues
Definition: igb.h:551
struct e1000_mac_info mac
Definition: e1000_hw.h:762
static void igb_free_all_tx_resources(struct igb_adapter *)
Definition: igb_main.c:4164
static int igb_setup_all_rx_resources(struct igb_adapter *)
Definition: igb_main.c:3698
void igb_power_up_link(struct igb_adapter *adapter)
Definition: igb_main.c:1620
u32 vmdq_pools
Definition: igb.h:627
struct work_struct watchdog_task
Definition: igb.h:570
#define E1000_CTRL_EXT_PFRSTD
Definition: e1000_defines.h:69
unsigned long state
Definition: igb.h:537
static void igb_free_all_rx_resources(struct igb_adapter *)
Definition: igb_main.c:4266
struct igb_q_vector * q_vector[MAX_Q_VECTORS]
Definition: igb.h:607
bool get_link_status
Definition: e1000_hw.h:633
#define E1000_SUCCESS
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
struct work_struct dma_err_task
Definition: igb.h:571
void igb_reset(struct igb_adapter *adapter)
Definition: igb_main.c:1967
u_int32_t u32
Definition: e1000_osdep.h:50
struct napi_struct napi
Definition: igb.h:421
#define IGB_FLAG_DETECT_BAD_DMA
Definition: igb.h:719
static void igb_configure(struct igb_adapter *)
Definition: igb_main.c:1579
static int igb_setup_all_tx_resources(struct igb_adapter *)
Definition: igb_main.c:3535
static void igb_configure_lli(struct igb_adapter *adapter)
Definition: igb_main.c:492
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
static void igb_irq_enable(struct igb_adapter *adapter)
Definition: igb_main.c:1478

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int __igb_shutdown ( struct pci_dev *  pdev,
bool enable_wake,
bool  runtime 
)
static

igb_main.c 파일의 9249 번째 라인에서 정의되었습니다.

9251 {
9252  struct net_device *netdev = pci_get_drvdata(pdev);
9253  struct igb_adapter *adapter = netdev_priv(netdev);
9254  struct e1000_hw *hw = &adapter->hw;
9255  u32 ctrl, rctl, status;
9256  u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol;
9257 #ifdef CONFIG_PM
9258  int retval = 0;
9259 #endif
9260 
9261  netif_device_detach(netdev);
9262 
9263  status = E1000_READ_REG(hw, E1000_STATUS);
9264  if (status & E1000_STATUS_LU)
9265  wufc &= ~E1000_WUFC_LNKC;
9266 
9267  if (netif_running(netdev))
9268  __igb_close(netdev, true);
9269 
9270  if(system_state != SYSTEM_RUNNING)
9271  igb_clear_interrupt_scheme(adapter);
9272 
9273 #ifdef CONFIG_PM
9274  retval = pci_save_state(pdev);
9275  if (retval)
9276  return retval;
9277 #endif
9278 
9279  if (wufc) {
9280  igb_setup_rctl(adapter);
9281  igb_set_rx_mode(netdev);
9282 
9283  /* turn on all-multi mode if wake on multicast is enabled */
9284  if (wufc & E1000_WUFC_MC) {
9285  rctl = E1000_READ_REG(hw, E1000_RCTL);
9286  rctl |= E1000_RCTL_MPE;
9287  E1000_WRITE_REG(hw, E1000_RCTL, rctl);
9288  }
9289 
9290  ctrl = E1000_READ_REG(hw, E1000_CTRL);
9291  /* phy power management enable */
9292  #define E1000_CTRL_EN_PHY_PWR_MGMT 0x00200000
9293  ctrl |= E1000_CTRL_ADVD3WUC;
9294  E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
9295 
9296  /* Allow time for pending master requests to run */
9298 
9300  E1000_WRITE_REG(hw, E1000_WUFC, wufc);
9301  } else {
9302  E1000_WRITE_REG(hw, E1000_WUC, 0);
9303  E1000_WRITE_REG(hw, E1000_WUFC, 0);
9304  }
9305 
9306  *enable_wake = wufc || adapter->en_mng_pt;
9307  if (!*enable_wake)
9308  igb_power_down_link(adapter);
9309  else
9310  igb_power_up_link(adapter);
9311 
9312  /* Release control of h/w to f/w. If f/w is AMT enabled, this
9313  * would have already happened in close and is redundant.
9314  */
9315  igb_release_hw_control(adapter);
9316 
9317  pci_disable_device(pdev);
9318 
9319  return 0;
9320 }
#define E1000_CTRL_ADVD3WUC
u32 wol
Definition: igb.h:559
struct e1000_hw hw
Definition: igb.h:594
static void igb_power_down_link(struct igb_adapter *adapter)
Definition: igb_main.c:1634
#define E1000_WUC
Definition: e1000_regs.h:430
#define E1000_CTRL
Definition: e1000_regs.h:28
#define E1000_RCTL
Definition: e1000_regs.h:61
static void igb_release_hw_control(struct igb_adapter *adapter)
Definition: igb_main.c:1544
#define E1000_WUFC_LNKC
Definition: e1000_defines.h:41
#define E1000_WUFC_MC
Definition: e1000_defines.h:44
static void igb_clear_interrupt_scheme(struct igb_adapter *adapter)
Definition: igb_main.c:855
static int __igb_close(struct net_device *netdev, bool suspending)
Definition: igb_main.c:3452
void igb_power_up_link(struct igb_adapter *adapter)
Definition: igb_main.c:1620
#define E1000_WUFC
Definition: e1000_regs.h:431
u32 en_mng_pt
Definition: igb.h:560
#define E1000_STATUS
Definition: e1000_regs.h:29
#define E1000_STATUS_LU
static void igb_set_rx_mode(struct net_device *)
Definition: igb_main.c:4567
void igb_setup_rctl(struct igb_adapter *adapter)
Definition: igb_main.c:3859
#define E1000_RCTL_MPE
s32 e1000_disable_pcie_master(struct e1000_hw *hw)
Definition: e1000_api.c:604
#define E1000_WUC_PME_EN
Definition: e1000_defines.h:35
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void e1000_read_pci_cfg ( struct e1000_hw hw,
u32  reg,
u16 value 
)

igb_main.c 파일의 8917 번째 라인에서 정의되었습니다.

8918 {
8919  struct igb_adapter *adapter = hw->back;
8920 
8921  pci_read_config_word(adapter->pdev, reg, value);
8922 }
struct pci_dev * pdev
Definition: igb.h:582
void * back
Definition: e1000_hw.h:756

이 함수를 호출하는 함수들에 대한 그래프입니다.:

s32 e1000_read_pcie_cap_reg ( struct e1000_hw hw,
u32  reg,
u16 value 
)

igb_main.c 파일의 8931 번째 라인에서 정의되었습니다.

8932 {
8933  struct igb_adapter *adapter = hw->back;
8934  u16 cap_offset;
8935 
8936  cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP);
8937  if (!cap_offset)
8938  return -E1000_ERR_CONFIG;
8939 
8940  pci_read_config_word(adapter->pdev, cap_offset + reg, value);
8941 
8942  return E1000_SUCCESS;
8943 }
struct pci_dev * pdev
Definition: igb.h:582
u_int16_t u16
Definition: e1000_osdep.h:51
void * back
Definition: e1000_hw.h:756
#define E1000_ERR_CONFIG
#define E1000_SUCCESS
#define PCI_CAP_ID_EXP
Definition: kcompat.h:164

이 함수를 호출하는 함수들에 대한 그래프입니다.:

u32 e1000_read_reg ( struct e1000_hw hw,
u32  reg 
)

igb_main.c 파일의 469 번째 라인에서 정의되었습니다.

470 {
471  struct igb_adapter *igb = container_of(hw, struct igb_adapter, hw);
472  u8 __iomem *hw_addr = READ_ONCE(hw->hw_addr);
473  u32 value = 0;
474 
475  if (E1000_REMOVED(hw_addr))
476  return ~value;
477 
478  value = readl(&hw_addr[reg]);
479 
480  /* reads should not return all F's */
481  if (!(~value) && (!reg || !(~readl(hw_addr)))) {
482  struct net_device *netdev = igb->netdev;
483 
484  hw->hw_addr = NULL;
485  netif_device_detach(netdev);
486  netdev_err(netdev, "PCIe link lost, device now detached\n");
487  }
488 
489  return value;
490 }
#define E1000_REMOVED(a)
Definition: e1000_mac.h:30
struct net_device * netdev
Definition: igb.h:535
u8 __iomem * hw_addr
Definition: e1000_hw.h:758
u_int8_t u8
Definition: e1000_osdep.h:52
u_int32_t u32
Definition: e1000_osdep.h:50
#define NULL
Null pointer value.
void e1000_write_pci_cfg ( struct e1000_hw hw,
u32  reg,
u16 value 
)

igb_main.c 파일의 8924 번째 라인에서 정의되었습니다.

8925 {
8926  struct igb_adapter *adapter = hw->back;
8927 
8928  pci_write_config_word(adapter->pdev, reg, *value);
8929 }
struct pci_dev * pdev
Definition: igb.h:582
void * back
Definition: e1000_hw.h:756

이 함수를 호출하는 함수들에 대한 그래프입니다.:

s32 e1000_write_pcie_cap_reg ( struct e1000_hw hw,
u32  reg,
u16 value 
)

igb_main.c 파일의 8945 번째 라인에서 정의되었습니다.

8946 {
8947  struct igb_adapter *adapter = hw->back;
8948  u16 cap_offset;
8949 
8950  cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP);
8951  if (!cap_offset)
8952  return -E1000_ERR_CONFIG;
8953 
8954  pci_write_config_word(adapter->pdev, cap_offset + reg, *value);
8955 
8956  return E1000_SUCCESS;
8957 }
struct pci_dev * pdev
Definition: igb.h:582
u_int16_t u16
Definition: e1000_osdep.h:51
void * back
Definition: e1000_hw.h:756
#define E1000_ERR_CONFIG
#define E1000_SUCCESS
#define PCI_CAP_ID_EXP
Definition: kcompat.h:164

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

int igb_add_mac_filter ( struct igb_adapter adapter,
u8 addr,
u16  queue 
)

igb_main.c 파일의 9676 번째 라인에서 정의되었습니다.

9677 {
9678  struct e1000_hw *hw = &adapter->hw;
9679  int i;
9680 
9681  if (is_zero_ether_addr(addr))
9682  return 0;
9683 
9684  for (i = 0; i < hw->mac.rar_entry_count; i++) {
9685  if (adapter->mac_table[i].state & IGB_MAC_STATE_IN_USE)
9686  continue;
9687  adapter->mac_table[i].state = (IGB_MAC_STATE_MODIFIED |
9689  memcpy(adapter->mac_table[i].addr, addr, ETH_ALEN);
9690  adapter->mac_table[i].queue = queue;
9691  igb_sync_mac_table(adapter);
9692  return 0;
9693  }
9694  return -ENOMEM;
9695 }
void igb_sync_mac_table(struct igb_adapter *adapter)
Definition: igb_main.c:4454
u16 queue
Definition: igb.h:447
struct e1000_hw hw
Definition: igb.h:594
u8 addr[ETH_ALEN]
Definition: igb.h:446
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define ETH_ALEN
#define IGB_MAC_STATE_MODIFIED
Definition: igb.h:451
struct igb_mac_addr * mac_table
Definition: igb.h:630
#define IGB_MAC_STATE_IN_USE
Definition: igb.h:452
u16 rar_entry_count
Definition: e1000_hw.h:623
u16 state
Definition: igb.h:448

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static void igb_add_ring ( struct igb_ring ring,
struct igb_ring_container head 
)
static

igb_main.c 파일의 1139 번째 라인에서 정의되었습니다.

1141 {
1142  head->ring = ring;
1143  head->count++;
1144 }
struct igb_ring * ring
Definition: igb.h:357

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static bool igb_add_rx_frag ( struct igb_ring rx_ring,
struct igb_rx_buffer rx_buffer,
union e1000_adv_rx_desc rx_desc,
struct sk_buff *  skb 
)
static

igb_add_rx_frag - Add contents of Rx buffer to sk_buff : rx descriptor ring to transact packets on : buffer containing page to add : descriptor containing length of buffer written by hardware : sk_buff to place the data into

This function will add the data contained in rx_buffer->page to the skb. This is done either through a direct copy if the data in the buffer is less than the skb header size, otherwise it will just attach the page as a frag to the skb.

The function will then update the page offset if necessary and return true if the buffer can be reused by the adapter.

igb_main.c 파일의 7567 번째 라인에서 정의되었습니다.

7571 {
7572  struct page *page = rx_buffer->page;
7573  unsigned int size = le16_to_cpu(rx_desc->wb.upper.length);
7574 #if (PAGE_SIZE < 8192)
7575  unsigned int truesize = IGB_RX_BUFSZ;
7576 #else
7577  unsigned int truesize = ALIGN(size, L1_CACHE_BYTES);
7578 #endif
7579 
7580  if ((size <= IGB_RX_HDR_LEN) && !skb_is_nonlinear(skb)) {
7581  unsigned char *va = page_address(page) + rx_buffer->page_offset;
7582 
7583 #ifdef HAVE_PTP_1588_CLOCK
7584  if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP)) {
7585  igb_ptp_rx_pktstamp(rx_ring->q_vector, va, skb);
7586  va += IGB_TS_HDR_LEN;
7587  size -= IGB_TS_HDR_LEN;
7588  }
7589 #endif /* HAVE_PTP_1588_CLOCK */
7590 
7591  memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long)));
7592 
7593  /* we can reuse buffer as-is, just make sure it is local */
7594  if (likely(page_to_nid(page) == numa_node_id()))
7595  return true;
7596 
7597  /* this page cannot be reused so discard it */
7598  put_page(page);
7599  return false;
7600  }
7601 
7602  skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
7603  rx_buffer->page_offset, size, truesize);
7604 
7605  return igb_can_reuse_rx_page(rx_buffer, page, truesize);
7606 }
struct e1000_adv_rx_desc::@29::@31 upper
#define IGB_RX_HDR_LEN
Definition: igb.h:196
#define likely(_x)
Definition: kcompat.h:255
#define IGB_RX_BUFSZ
Definition: igb.h:198
int size
static bool igb_can_reuse_rx_page(struct igb_rx_buffer *rx_buffer, struct page *page, unsigned int truesize)
Definition: igb_main.c:7522
static __le32 igb_test_staterr(union e1000_adv_rx_desc *rx_desc, const u32 stat_err_bits)
Definition: igb.h:474
struct e1000_adv_rx_desc::@29 wb
#define IGB_TS_HDR_LEN
Definition: igb.h:757
u32 page_offset
Definition: igb.h:326
struct page * page
Definition: igb.h:325
struct igb_q_vector * q_vector
Definition: igb.h:366
#define E1000_RXDADV_STAT_TSIP
Definition: e1000_82575.h:220

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static bool igb_alloc_mapped_page ( struct igb_ring rx_ring,
struct igb_rx_buffer bi 
)
static

igb_main.c 파일의 8739 번째 라인에서 정의되었습니다.

8741 {
8742  struct page *page = bi->page;
8743  dma_addr_t dma;
8744 
8745  /* since we are recycling buffers we should seldom need to alloc */
8746  if (likely(page))
8747  return true;
8748 
8749  /* alloc new page for storage */
8750  page = alloc_page(GFP_ATOMIC | __GFP_COLD);
8751  if (unlikely(!page)) {
8752  rx_ring->rx_stats.alloc_failed++;
8753  return false;
8754  }
8755 
8756  /* map page for use */
8757  dma = dma_map_page(rx_ring->dev, page, 0, PAGE_SIZE, DMA_FROM_DEVICE);
8758 
8759  /*
8760  * if mapping failed free memory back to system since
8761  * there isn't much point in holding memory we can't use
8762  */
8763  if (dma_mapping_error(rx_ring->dev, dma)) {
8764  __free_page(page);
8765 
8766  rx_ring->rx_stats.alloc_failed++;
8767  return false;
8768  }
8769 
8770  bi->dma = dma;
8771  bi->page = page;
8772  bi->page_offset = 0;
8773 
8774  return true;
8775 }
u64 alloc_failed
Definition: igb.h:341
struct device * dev
Definition: igb.h:368
static struct igb_packet * alloc_page(device_t *dev, struct igb_dma_alloc *a_page)
Definition: openavb_igb.c:66
#define likely(_x)
Definition: kcompat.h:255
#define __GFP_COLD
Definition: kcompat.h:359
dma_addr_t dma
Definition: igb.h:321
struct igb_rx_queue_stats rx_stats
Definition: igb.h:395
#define unlikely(_x)
Definition: kcompat.h:254
u32 page_offset
Definition: igb.h:326
struct page * page
Definition: igb.h:325

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_alloc_q_vector ( struct igb_adapter adapter,
unsigned int  v_count,
unsigned int  v_idx,
unsigned int  txr_count,
unsigned int  txr_idx,
unsigned int  rxr_count,
unsigned int  rxr_idx 
)
static

igb_alloc_q_vector - Allocate memory for a single interrupt vector : board private structure to initialize : q_vectors allocated on adapter, used for ring interleaving : index of vector in adapter struct : total number of Tx rings to allocate : index of first Tx ring to allocate : total number of Rx rings to allocate : index of first Rx ring to allocate

We allocate one q_vector. If allocation fails we return -ENOMEM.

igb_main.c 파일의 1158 번째 라인에서 정의되었습니다.

1162 {
1163  struct igb_q_vector *q_vector;
1164  struct igb_ring *ring;
1165  int ring_count, size;
1166 
1167  /* igb only supports 1 Tx and/or 1 Rx queue per vector */
1168  if (txr_count > 1 || rxr_count > 1)
1169  return -ENOMEM;
1170 
1171  ring_count = txr_count + rxr_count;
1172  size = sizeof(struct igb_q_vector) +
1173  (sizeof(struct igb_ring) * ring_count);
1174 
1175  /* allocate q_vector and rings */
1176  q_vector = adapter->q_vector[v_idx];
1177  if (!q_vector)
1178  q_vector = kzalloc(size, GFP_KERNEL);
1179  else
1180  memset(q_vector, 0, size);
1181  if (!q_vector)
1182  return -ENOMEM;
1183 
1184 #ifndef IGB_NO_LRO
1185  /* initialize LRO */
1186  __skb_queue_head_init(&q_vector->lrolist.active);
1187 
1188 #endif
1189  /* initialize NAPI */
1190  netif_napi_add(adapter->netdev, &q_vector->napi,
1191  igb_poll, 64);
1192 
1193  /* tie q_vector and adapter together */
1194  adapter->q_vector[v_idx] = q_vector;
1195  q_vector->adapter = adapter;
1196 
1197  /* initialize work limits */
1198  q_vector->tx.work_limit = adapter->tx_work_limit;
1199 
1200  /* initialize ITR configuration */
1201  q_vector->itr_register = adapter->hw.hw_addr + E1000_EITR(0);
1202  q_vector->itr_val = IGB_START_ITR;
1203 
1204  /* initialize pointer to rings */
1205  ring = q_vector->ring;
1206 
1207  /* intialize ITR */
1208  if (rxr_count) {
1209  /* rx or rx/tx vector */
1210  if (!adapter->rx_itr_setting || adapter->rx_itr_setting > 3)
1211  q_vector->itr_val = adapter->rx_itr_setting;
1212  } else {
1213  /* tx only vector */
1214  if (!adapter->tx_itr_setting || adapter->tx_itr_setting > 3)
1215  q_vector->itr_val = adapter->tx_itr_setting;
1216  }
1217 
1218  if (txr_count) {
1219  /* assign generic ring traits */
1220  ring->dev = &adapter->pdev->dev;
1221  ring->netdev = adapter->netdev;
1222 
1223  /* configure backlink on ring */
1224  ring->q_vector = q_vector;
1225 
1226  /* update q_vector Tx values */
1227  igb_add_ring(ring, &q_vector->tx);
1228 
1229  /* For 82575, context index must be unique per ring. */
1230  if (adapter->hw.mac.type == e1000_82575)
1231  set_bit(IGB_RING_FLAG_TX_CTX_IDX, &ring->flags);
1232 
1233  /* apply Tx specific ring traits */
1234  ring->count = adapter->tx_ring_count;
1235  ring->queue_index = txr_idx;
1236 
1237  /* assign ring to adapter */
1238  adapter->tx_ring[txr_idx] = ring;
1239 
1240  /* push pointer to next ring */
1241  ring++;
1242  }
1243 
1244  if (rxr_count) {
1245  /* assign generic ring traits */
1246  ring->dev = &adapter->pdev->dev;
1247  ring->netdev = adapter->netdev;
1248 
1249  /* configure backlink on ring */
1250  ring->q_vector = q_vector;
1251 
1252  /* update q_vector Rx values */
1253  igb_add_ring(ring, &q_vector->rx);
1254 
1255 #if defined(HAVE_RHEL6_NET_DEVICE_OPS_EXT) || !defined(HAVE_NDO_SET_FEATURES)
1256  /* enable rx checksum */
1257  set_bit(IGB_RING_FLAG_RX_CSUM, &ring->flags);
1258 
1259 #endif
1260  /* set flag indicating ring supports SCTP checksum offload */
1261  if (adapter->hw.mac.type >= e1000_82576)
1262  set_bit(IGB_RING_FLAG_RX_SCTP_CSUM, &ring->flags);
1263 
1264  if ((adapter->hw.mac.type == e1000_i350) ||
1265  (adapter->hw.mac.type == e1000_i354))
1266  set_bit(IGB_RING_FLAG_RX_LB_VLAN_BSWAP, &ring->flags);
1267 
1268  /* apply Rx specific ring traits */
1269  ring->count = adapter->rx_ring_count;
1270  ring->queue_index = rxr_idx;
1271 
1272  /* assign ring to adapter */
1273  adapter->rx_ring[rxr_idx] = ring;
1274  }
1275 
1276  return 0;
1277 }
void __iomem * itr_register
Definition: igb.h:417
u16 count
Definition: igb.h:379
struct e1000_hw hw
Definition: igb.h:594
struct device * dev
Definition: igb.h:368
struct net_device * netdev
Definition: igb.h:535
u16 tx_ring_count
Definition: igb.h:613
struct pci_dev * pdev
Definition: igb.h:582
#define IGB_START_ITR
Definition: igb.h:99
u16 tx_work_limit
Definition: igb.h:545
struct igb_adapter * adapter
Definition: igb.h:411
u8 queue_index
Definition: igb.h:380
Definition: igb.h:365
u16 work_limit
Definition: igb.h:360
#define E1000_EITR(_n)
Definition: e1000_regs.h:66
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
struct igb_lro_list lrolist
Definition: igb.h:423
u8 __iomem * hw_addr
Definition: e1000_hw.h:758
struct igb_ring * rx_ring[IGB_MAX_RX_QUEUES]
Definition: igb.h:552
struct net_device * netdev
Definition: igb.h:367
struct igb_ring_container rx tx
Definition: igb.h:419
struct igb_q_vector * q_vector[MAX_Q_VECTORS]
Definition: igb.h:607
struct igb_ring * tx_ring[IGB_MAX_TX_QUEUES]
Definition: igb.h:548
int size
u32 rx_itr_setting
Definition: igb.h:566
struct sk_buff_head active
Definition: igb.h:247
u16 itr_val
Definition: igb.h:415
static int igb_poll(struct napi_struct *, int)
Definition: igb_main.c:7236
u16 rx_ring_count
Definition: igb.h:614
u32 tx_itr_setting
Definition: igb.h:567
unsigned long flags
Definition: igb.h:374
struct napi_struct napi
Definition: igb.h:421
static void igb_add_ring(struct igb_ring *ring, struct igb_ring_container *head)
Definition: igb_main.c:1139
struct igb_q_vector * q_vector
Definition: igb.h:366

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_alloc_q_vectors ( struct igb_adapter adapter)
static

igb_alloc_q_vectors - Allocate memory for interrupt vectors : board private structure to initialize

We allocate one q_vector per queue interrupt. If allocation fails we return -ENOMEM.

igb_main.c 파일의 1286 번째 라인에서 정의되었습니다.

1287 {
1288  int q_vectors = adapter->num_q_vectors;
1289  int rxr_remaining = adapter->num_rx_queues;
1290  int txr_remaining = adapter->num_tx_queues;
1291  int rxr_idx = 0, txr_idx = 0, v_idx = 0;
1292  int err;
1293 
1294  if (q_vectors >= (rxr_remaining + txr_remaining)) {
1295  for (; rxr_remaining; v_idx++) {
1296  err = igb_alloc_q_vector(adapter, q_vectors, v_idx,
1297  0, 0, 1, rxr_idx);
1298 
1299  if (err)
1300  goto err_out;
1301 
1302  /* update counts and index */
1303  rxr_remaining--;
1304  rxr_idx++;
1305  }
1306  }
1307 
1308  for (; v_idx < q_vectors; v_idx++) {
1309  int rqpv = DIV_ROUND_UP(rxr_remaining, q_vectors - v_idx);
1310  int tqpv = DIV_ROUND_UP(txr_remaining, q_vectors - v_idx);
1311 
1312  err = igb_alloc_q_vector(adapter, q_vectors, v_idx,
1313  tqpv, txr_idx, rqpv, rxr_idx);
1314 
1315  if (err)
1316  goto err_out;
1317 
1318  /* update counts and index */
1319  rxr_remaining -= rqpv;
1320  txr_remaining -= tqpv;
1321  rxr_idx++;
1322  txr_idx++;
1323  }
1324 
1325  return 0;
1326 
1327 err_out:
1328  adapter->num_tx_queues = 0;
1329  adapter->num_rx_queues = 0;
1330  adapter->num_q_vectors = 0;
1331 
1332  while (v_idx--)
1333  igb_free_q_vector(adapter, v_idx);
1334 
1335  return -ENOMEM;
1336 }
unsigned int num_q_vectors
Definition: igb.h:540
int err
static int igb_alloc_q_vector(struct igb_adapter *adapter, unsigned int v_count, unsigned int v_idx, unsigned int txr_count, unsigned int txr_idx, unsigned int rxr_count, unsigned int rxr_idx)
Definition: igb_main.c:1158
int num_tx_queues
Definition: igb.h:547
int num_rx_queues
Definition: igb.h:551
static void igb_free_q_vector(struct igb_adapter *adapter, int v_idx)
Definition: igb_main.c:767

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_alloc_rx_buffers ( struct igb_ring rx_ring,
u16  cleaned_count 
)

igb_alloc_rx_buffers - Replace used receive buffers; packet split : address of board private structure

igb_main.c 파일의 8782 번째 라인에서 정의되었습니다.

8783 {
8784  union e1000_adv_rx_desc *rx_desc;
8785  struct igb_rx_buffer *bi;
8786  u16 i = rx_ring->next_to_use;
8787 
8788  /* nothing to do */
8789  if (!cleaned_count)
8790  return;
8791 
8792  rx_desc = IGB_RX_DESC(rx_ring, i);
8793  bi = &rx_ring->rx_buffer_info[i];
8794  i -= rx_ring->count;
8795 
8796  do {
8797 #ifdef CONFIG_IGB_DISABLE_PACKET_SPLIT
8798  if (!igb_alloc_mapped_skb(rx_ring, bi))
8799 #else
8800  if (!igb_alloc_mapped_page(rx_ring, bi))
8801 #endif /* CONFIG_IGB_DISABLE_PACKET_SPLIT */
8802  break;
8803 
8804  /*
8805  * Refresh the desc even if buffer_addrs didn't change
8806  * because each write-back erases this info.
8807  */
8808 #ifdef CONFIG_IGB_DISABLE_PACKET_SPLIT
8809  rx_desc->read.pkt_addr = cpu_to_le64(bi->dma);
8810 #else
8811  rx_desc->read.pkt_addr = cpu_to_le64(bi->dma + bi->page_offset);
8812 #endif
8813 
8814  rx_desc++;
8815  bi++;
8816  i++;
8817  if (unlikely(!i)) {
8818  rx_desc = IGB_RX_DESC(rx_ring, 0);
8819  bi = rx_ring->rx_buffer_info;
8820  i -= rx_ring->count;
8821  }
8822 
8823  /* clear the hdr_addr for the next_to_use descriptor */
8824  rx_desc->read.hdr_addr = 0;
8825 
8826  cleaned_count--;
8827  } while (cleaned_count);
8828 
8829  i += rx_ring->count;
8830 
8831  if (rx_ring->next_to_use != i) {
8832  /* record the next descriptor to use */
8833  rx_ring->next_to_use = i;
8834 
8835 #ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
8836  /* update next to alloc since we have filled the ring */
8837  rx_ring->next_to_alloc = i;
8838 
8839 #endif
8840  /*
8841  * Force memory writes to complete before letting h/w
8842  * know there are new descriptors to fetch. (Only
8843  * applicable for weak-ordered memory model archs,
8844  * such as IA-64).
8845  */
8846  wmb();
8847  writel(i, rx_ring->tail);
8848  }
8849 }
u16 count
Definition: igb.h:379
struct e1000_adv_rx_desc::@28 read
struct igb_rx_buffer * rx_buffer_info
Definition: igb.h:371
u16 next_to_use
Definition: igb.h:385
u_int16_t u16
Definition: e1000_osdep.h:51
#define IGB_RX_DESC(R, i)
Definition: igb.h:456
void __iomem * tail
Definition: igb.h:375
static bool igb_alloc_mapped_page(struct igb_ring *rx_ring, struct igb_rx_buffer *bi)
Definition: igb_main.c:8739
u16 next_to_alloc
Definition: igb.h:386
#define wmb()
Definition: e1000_osdep.h:64
dma_addr_t dma
Definition: igb.h:321
#define unlikely(_x)
Definition: kcompat.h:254
u32 page_offset
Definition: igb.h:326

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_assign_vector ( struct igb_q_vector q_vector,
int  msix_vector 
)
static

igb_main.c 파일의 555 번째 라인에서 정의되었습니다.

556 {
557  struct igb_adapter *adapter = q_vector->adapter;
558  struct e1000_hw *hw = &adapter->hw;
559  int rx_queue = IGB_N0_QUEUE;
560  int tx_queue = IGB_N0_QUEUE;
561  u32 msixbm = 0;
562 
563  if (q_vector->rx.ring)
564  rx_queue = q_vector->rx.ring->reg_idx;
565  if (q_vector->tx.ring)
566  tx_queue = q_vector->tx.ring->reg_idx;
567 
568  switch (hw->mac.type) {
569  case e1000_82575:
570  /* The 82575 assigns vectors using a bitmask, which matches the
571  * bitmask for the EICR/EIMS/EIMC registers. To assign one
572  * or more queues to a vector, we write the appropriate bits
573  * into the MSIXBM register for that vector.
574  */
575  if (rx_queue > IGB_N0_QUEUE)
576  msixbm = E1000_EICR_RX_QUEUE0 << rx_queue;
577  if (tx_queue > IGB_N0_QUEUE)
578  msixbm |= E1000_EICR_TX_QUEUE0 << tx_queue;
579  if (!adapter->msix_entries && msix_vector == 0)
580  msixbm |= E1000_EIMS_OTHER;
581  E1000_WRITE_REG_ARRAY(hw, E1000_MSIXBM(0), msix_vector, msixbm);
582  q_vector->eims_value = msixbm;
583  break;
584  case e1000_82576:
585  /*
586  * 82576 uses a table that essentially consists of 2 columns
587  * with 8 rows. The ordering is column-major so we use the
588  * lower 3 bits as the row index, and the 4th bit as the
589  * column offset.
590  */
591  if (rx_queue > IGB_N0_QUEUE)
592  igb_write_ivar(hw, msix_vector,
593  rx_queue & 0x7,
594  (rx_queue & 0x8) << 1);
595  if (tx_queue > IGB_N0_QUEUE)
596  igb_write_ivar(hw, msix_vector,
597  tx_queue & 0x7,
598  ((tx_queue & 0x8) << 1) + 8);
599  q_vector->eims_value = 1 << msix_vector;
600  break;
601  case e1000_82580:
602  case e1000_i350:
603  case e1000_i354:
604  case e1000_i210:
605  case e1000_i211:
606  /*
607  * On 82580 and newer adapters the scheme is similar to 82576
608  * however instead of ordering column-major we have things
609  * ordered row-major. So we traverse the table by using
610  * bit 0 as the column offset, and the remaining bits as the
611  * row index.
612  */
613  if (rx_queue > IGB_N0_QUEUE)
614  igb_write_ivar(hw, msix_vector,
615  rx_queue >> 1,
616  (rx_queue & 0x1) << 4);
617  if (tx_queue > IGB_N0_QUEUE)
618  igb_write_ivar(hw, msix_vector,
619  tx_queue >> 1,
620  ((tx_queue & 0x1) << 4) + 8);
621  q_vector->eims_value = 1 << msix_vector;
622  break;
623  default:
624  BUG();
625  break;
626  }
627 
628  /* add q_vector eims value to global eims_enable_mask */
629  adapter->eims_enable_mask |= q_vector->eims_value;
630 
631  /* configure q_vector to set itr on first interrupt */
632  q_vector->set_itr = 1;
633 }
#define E1000_WRITE_REG_ARRAY(hw, reg, idx, val)
Definition: e1000_osdep.h:100
struct msix_entry * msix_entries
Definition: igb.h:541
struct e1000_hw hw
Definition: igb.h:594
u8 reg_idx
Definition: igb.h:381
#define E1000_EIMS_OTHER
u8 set_itr
Definition: igb.h:416
static void igb_write_ivar(struct e1000_hw *hw, int msix_vector, int index, int offset)
Definition: igb_main.c:540
struct igb_adapter * adapter
Definition: igb.h:411
u32 eims_value
Definition: igb.h:413
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define E1000_EICR_TX_QUEUE0
enum e1000_mac_type type
Definition: e1000_hw.h:602
#define IGB_N0_QUEUE
Definition: igb_main.c:554
#define E1000_MSIXBM(_i)
Definition: e1000_regs.h:480
struct igb_ring_container rx tx
Definition: igb.h:419
u32 eims_enable_mask
Definition: igb.h:608
#define E1000_EICR_RX_QUEUE0
u_int32_t u32
Definition: e1000_osdep.h:50
struct igb_ring * ring
Definition: igb.h:357

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

int igb_available_rars ( struct igb_adapter adapter)

igb_main.c 파일의 4466 번째 라인에서 정의되었습니다.

4467 {
4468  struct e1000_hw *hw = &adapter->hw;
4469  int i, count = 0;
4470 
4471  for (i = 0; i < hw->mac.rar_entry_count; i++) {
4472  if (adapter->mac_table[i].state == 0)
4473  count++;
4474  }
4475  return count;
4476 }
struct e1000_hw hw
Definition: igb.h:594
struct e1000_mac_info mac
Definition: e1000_hw.h:762
struct igb_mac_addr * mac_table
Definition: igb.h:630
u16 rar_entry_count
Definition: e1000_hw.h:623
u16 state
Definition: igb.h:448

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_bind ( struct file *  file,
void __user *  argp 
)
static

igb_main.c 파일의 10264 번째 라인에서 정의되었습니다.

10265 {
10266  struct igb_private_data *igb_priv = file->private_data;
10267  struct igb_adapter *adapter;
10268  struct igb_bind_cmd req;
10269  int err = 0;
10270 
10271  if (copy_from_user(&req, argp, sizeof(req)))
10272  return -EFAULT;
10273 
10274  /*
10275  * Set the last character of req.iface to '/0' to
10276  * guarantee null termination of req.iface string
10277  * param in printk call.
10278  */
10279 
10280  req.iface[IGB_BIND_NAMESZ-1] = 0;
10281  printk("bind to iface %s\n", req.iface);
10282 
10283  if (igb_priv == NULL) {
10284  printk("cannot find private data!\n");
10285  return -ENOENT;
10286  }
10287 
10288  adapter = igb_lookup(req.iface);
10289  if (adapter == NULL) {
10290  printk("lookup failed to iface %s\n", req.iface);
10291  return -ENOENT;
10292  }
10293 
10294  igb_priv->adapter = adapter;
10295 
10296  req.mmap_size = 0;
10297  req.mmap_size = pci_resource_len(adapter->pdev, 0);
10298 
10299  if (copy_to_user(argp, &req, sizeof(req))) {
10300  printk("copyout to user failed\n");
10301  err = -EFAULT;
10302  goto failed;
10303  }
10304 
10305  return 0;
10306 
10307 failed:
10308  igb_priv->adapter = NULL;
10309  return err;
10310 }
struct igb_adapter * adapter
Definition: igb.h:929
int err
struct pci_dev * pdev
Definition: igb.h:582
#define IGB_BIND_NAMESZ
static struct igb_adapter * igb_lookup(char *id)
Definition: igb_main.c:10245
static struct argp argp
Definition: aaf-listener.c:125
#define NULL
Null pointer value.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_cache_ring_register ( struct igb_adapter adapter)
static

igb_cache_ring_register - Descriptor ring to register mapping : board private structure to initialize

Once we know the feature-set enabled for the device, we'll cache the register offset the descriptor ring is assigned to.

igb_main.c 파일의 458 번째 라인에서 정의되었습니다.

459 {
460  int i = 0, j = 0;
461  u32 rbase_offset = adapter->vfs_allocated_count;
462 
463  for (; i < adapter->num_rx_queues; i++)
464  adapter->rx_ring[i]->reg_idx = rbase_offset + i;
465  for (; j < adapter->num_tx_queues; j++)
466  adapter->tx_ring[j]->reg_idx = rbase_offset + j;
467 }
unsigned int vfs_allocated_count
Definition: igb.h:621
u8 reg_idx
Definition: igb.h:381
int num_tx_queues
Definition: igb.h:547
int num_rx_queues
Definition: igb.h:551
struct igb_ring * rx_ring[IGB_MAX_RX_QUEUES]
Definition: igb.h:552
struct igb_ring * tx_ring[IGB_MAX_TX_QUEUES]
Definition: igb.h:548
u_int32_t u32
Definition: e1000_osdep.h:50

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static bool igb_can_lro ( struct igb_ring rx_ring,
union e1000_adv_rx_desc rx_desc,
struct sk_buff *  skb 
)
inlinestatic

igb_can_lro - returns true if packet is TCP/IPV4 and LRO is enabled : board private structure : pointer to the rx descriptor : pointer to the skb to be merged

igb_main.c 파일의 7800 번째 라인에서 정의되었습니다.

7803 {
7804  struct iphdr *iph = (struct iphdr *)skb->data;
7805  __le16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info;
7806 
7807  /* verify hardware indicates this is IPv4/TCP */
7808  if ((!(pkt_info & cpu_to_le16(E1000_RXDADV_PKTTYPE_TCP)) ||
7809  !(pkt_info & cpu_to_le16(E1000_RXDADV_PKTTYPE_IPV4))))
7810  return false;
7811 
7812  /* .. and LRO is enabled */
7813  if (!(netdev_ring(rx_ring)->features & NETIF_F_LRO))
7814  return false;
7815 
7816  /* .. and we are not in promiscuous mode */
7817  if (netdev_ring(rx_ring)->flags & IFF_PROMISC)
7818  return false;
7819 
7820  /* .. and the header is large enough for us to read IP/TCP fields */
7821  if (!pskb_may_pull(skb, sizeof(struct igb_lrohdr)))
7822  return false;
7823 
7824  /* .. and there are no VLANs on packet */
7825  if (skb->protocol != htons(ETH_P_IP))
7826  return false;
7827 
7828  /* .. and we are version 4 with no options */
7829  if (*(u8 *)iph != 0x45)
7830  return false;
7831 
7832  /* .. and the packet is not fragmented */
7833  if (iph->frag_off & htons(IP_MF | IP_OFFSET))
7834  return false;
7835 
7836  /* .. and that next header is TCP */
7837  if (iph->protocol != IPPROTO_TCP)
7838  return false;
7839 
7840  return true;
7841 }
#define E1000_RXDADV_PKTTYPE_IPV4
Definition: e1000_82575.h:239
#define netdev_ring(ring)
Definition: igb.h:469
#define __le16
Definition: e1000_hw.h:211
u_int8_t u8
Definition: e1000_osdep.h:52
#define NETIF_F_LRO
Definition: kcompat.h:220
#define E1000_RXDADV_PKTTYPE_TCP
Definition: e1000_82575.h:243
struct e1000_adv_rx_desc::@29 wb
#define IP_OFFSET
Definition: kcompat.h:367
struct e1000_adv_rx_desc::@29::@30 lower
const char features[]
Definition: feature_tests.c:2

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static bool igb_can_reuse_rx_page ( struct igb_rx_buffer rx_buffer,
struct page *  page,
unsigned int  truesize 
)
static

igb_main.c 파일의 7522 번째 라인에서 정의되었습니다.

7525 {
7526  /* avoid re-using remote pages */
7527  if (unlikely(page_to_nid(page) != numa_node_id()))
7528  return false;
7529 
7530 #if (PAGE_SIZE < 8192)
7531  /* if we are only owner of page we can reuse it */
7532  if (unlikely(page_count(page) != 1))
7533  return false;
7534 
7535  /* flip page offset to other buffer */
7536  rx_buffer->page_offset ^= IGB_RX_BUFSZ;
7537 
7538 #else
7539  /* move offset up to the next cache line */
7540  rx_buffer->page_offset += truesize;
7541 
7542  if (rx_buffer->page_offset > (PAGE_SIZE - IGB_RX_BUFSZ))
7543  return false;
7544 #endif
7545 
7546  /* bump ref count on page before it is given to the stack */
7547  get_page(page);
7548 
7549  return true;
7550 }
#define IGB_RX_BUFSZ
Definition: igb.h:198
#define unlikely(_x)
Definition: kcompat.h:254
u32 page_offset
Definition: igb.h:326

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_change_mtu ( struct net_device *  netdev,
int  new_mtu 
)
static

igb_change_mtu - Change the Maximum Transfer Unit : network interface device structure : new value for maximum frame size

Returns 0 on success, negative on failure

igb_main.c 파일의 5857 번째 라인에서 정의되었습니다.

5858 {
5859  struct igb_adapter *adapter = netdev_priv(netdev);
5860  struct e1000_hw *hw = &adapter->hw;
5861  struct pci_dev *pdev = adapter->pdev;
5862  int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
5863 
5864  if ((new_mtu < 68) || (max_frame > MAX_JUMBO_FRAME_SIZE)) {
5865  dev_err(pci_dev_to_dev(pdev), "Invalid MTU setting\n");
5866  return -EINVAL;
5867  }
5868 
5869 #define MAX_STD_JUMBO_FRAME_SIZE 9238
5870  if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) {
5871  dev_err(pci_dev_to_dev(pdev), "MTU > 9216 not supported.\n");
5872  return -EINVAL;
5873  }
5874 
5875  /* adjust max frame to be at least the size of a standard frame */
5876  if (max_frame < (ETH_FRAME_LEN + ETH_FCS_LEN))
5877  max_frame = ETH_FRAME_LEN + ETH_FCS_LEN;
5878 
5879  while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
5880  usleep_range(1000, 2000);
5881 
5882  /* igb_down has a dependency on max_frame_size */
5883  adapter->max_frame_size = max_frame;
5884 
5885  if (netif_running(netdev))
5886  igb_down(adapter);
5887 
5888  dev_info(pci_dev_to_dev(pdev), "changing MTU from %d to %d\n",
5889  netdev->mtu, new_mtu);
5890  netdev->mtu = new_mtu;
5891  hw->dev_spec._82575.mtu = new_mtu;
5892 
5893  if (netif_running(netdev))
5894  igb_up(adapter);
5895  else
5896  igb_reset(adapter);
5897 
5898  clear_bit(__IGB_RESETTING, &adapter->state);
5899 
5900  return 0;
5901 }
struct e1000_hw hw
Definition: igb.h:594
void igb_down(struct igb_adapter *adapter)
Definition: igb_main.c:1875
struct net_device * netdev
Definition: igb.h:535
union e1000_hw::@65 dev_spec
struct pci_dev * pdev
Definition: igb.h:582
u32 max_frame_size
Definition: igb.h:579
void igb_up(struct igb_adapter *adapter)
Definition: igb_main.c:1829
#define MAX_JUMBO_FRAME_SIZE
unsigned long state
Definition: igb.h:537
#define VLAN_HLEN
Definition: kcompat.h:292
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
void igb_reset(struct igb_adapter *adapter)
Definition: igb_main.c:1967
struct e1000_dev_spec_82575 _82575
Definition: e1000_hw.h:771
#define MAX_STD_JUMBO_FRAME_SIZE

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_check_swap_media ( struct igb_adapter adapter)
static

igb_main.c 파일의 1643 번째 라인에서 정의되었습니다.

1644 {
1645  struct e1000_hw *hw = &adapter->hw;
1646  u32 ctrl_ext, connsw;
1647  bool swap_now = false;
1648  bool link;
1649 
1650  ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
1651  connsw = E1000_READ_REG(hw, E1000_CONNSW);
1652  link = igb_has_link(adapter);
1653 
1654  /* need to live swap if current media is copper and we have fiber/serdes
1655  * to go to.
1656  */
1657 
1658  if ((hw->phy.media_type == e1000_media_type_copper) &&
1659  (!(connsw & E1000_CONNSW_AUTOSENSE_EN))) {
1660  swap_now = true;
1661  } else if (!(connsw & E1000_CONNSW_SERDESD)) {
1662  /* copper signal takes time to appear */
1663  if (adapter->copper_tries < 3) {
1664  adapter->copper_tries++;
1665  connsw |= E1000_CONNSW_AUTOSENSE_CONF;
1666  E1000_WRITE_REG(hw, E1000_CONNSW, connsw);
1667  return;
1668  } else {
1669  adapter->copper_tries = 0;
1670  if ((connsw & E1000_CONNSW_PHYSD) &&
1671  (!(connsw & E1000_CONNSW_PHY_PDN))) {
1672  swap_now = true;
1673  connsw &= ~E1000_CONNSW_AUTOSENSE_CONF;
1674  E1000_WRITE_REG(hw, E1000_CONNSW, connsw);
1675  }
1676  }
1677  }
1678 
1679  if (swap_now) {
1680  switch (hw->phy.media_type) {
1682  dev_info(pci_dev_to_dev(adapter->pdev),
1683  "%s:MAS: changing media to fiber/serdes\n",
1684  adapter->netdev->name);
1685  ctrl_ext |=
1687  adapter->flags |= IGB_FLAG_MEDIA_RESET;
1688  adapter->copper_tries = 0;
1689  break;
1692  dev_info(pci_dev_to_dev(adapter->pdev),
1693  "%s:MAS: changing media to copper\n",
1694  adapter->netdev->name);
1695  ctrl_ext &=
1697  adapter->flags |= IGB_FLAG_MEDIA_RESET;
1698  break;
1699  default:
1700  /* shouldn't get here during regular operation */
1701  dev_err(pci_dev_to_dev(adapter->pdev),
1702  "%s:AMS: Invalid media type found, returning\n",
1703  adapter->netdev->name);
1704  break;
1705  }
1706  E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext);
1707  }
1708 }
struct e1000_hw hw
Definition: igb.h:594
#define E1000_CTRL_EXT
Definition: e1000_regs.h:32
struct net_device * netdev
Definition: igb.h:535
struct e1000_phy_info phy
Definition: e1000_hw.h:764
#define IGB_FLAG_MEDIA_RESET
Definition: igb.h:726
struct pci_dev * pdev
Definition: igb.h:582
#define E1000_CONNSW_PHYSD
unsigned int flags
Definition: igb.h:538
enum e1000_media_type media_type
Definition: e1000_hw.h:657
#define E1000_CONNSW
Definition: e1000_regs.h:52
#define E1000_CONNSW_PHY_PDN
#define E1000_CONNSW_AUTOSENSE_CONF
#define E1000_CONNSW_AUTOSENSE_EN
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
int copper_tries
Definition: igb.h:687
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_CONNSW_SERDESD
u_int32_t u32
Definition: e1000_osdep.h:50
bool igb_has_link(struct igb_adapter *adapter)
Definition: igb_main.c:4720
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
#define E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES
Definition: e1000_defines.h:79

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_check_wvbr ( struct igb_adapter adapter)
static

igb_main.c 파일의 4637 번째 라인에서 정의되었습니다.

4638 {
4639  struct e1000_hw *hw = &adapter->hw;
4640  u32 wvbr = 0;
4641 
4642  switch (hw->mac.type) {
4643  case e1000_82576:
4644  case e1000_i350:
4645  wvbr = E1000_READ_REG(hw, E1000_WVBR);
4646  if (!wvbr)
4647  return;
4648  break;
4649  default:
4650  break;
4651  }
4652 
4653  adapter->wvbr |= wvbr;
4654 }
struct e1000_hw hw
Definition: igb.h:594
u32 wvbr
Definition: igb.h:629
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_WVBR
Definition: e1000_regs.h:494
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_clean_all_rx_rings ( struct igb_adapter adapter)
static

igb_clean_all_rx_rings - Free Rx Buffers for all queues : board private structure

igb_main.c 파일의 4337 번째 라인에서 정의되었습니다.

4338 {
4339  int i;
4340 
4341  /* AVB specific */
4342  for (i = 2; i < adapter->num_rx_queues; i++)
4343  igb_clean_rx_ring(adapter->rx_ring[i]);
4344 }
void igb_clean_rx_ring(struct igb_ring *rx_ring)
Definition: igb_main.c:4278
int num_rx_queues
Definition: igb.h:551
struct igb_ring * rx_ring[IGB_MAX_RX_QUEUES]
Definition: igb.h:552

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_clean_all_tx_rings ( struct igb_adapter adapter)
static

igb_clean_all_tx_rings - Free Tx Buffers for all queues : board private structure

igb_main.c 파일의 4229 번째 라인에서 정의되었습니다.

4230 {
4231  int i;
4232 
4233  for (i = 0; i < adapter->num_tx_queues; i++)
4234  igb_clean_tx_ring(adapter->tx_ring[i]);
4235 }
int num_tx_queues
Definition: igb.h:547
struct igb_ring * tx_ring[IGB_MAX_TX_QUEUES]
Definition: igb.h:548
static void igb_clean_tx_ring(struct igb_ring *)
Definition: igb_main.c:4198

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static bool igb_clean_rx_irq ( struct igb_q_vector q_vector,
int  budget 
)
static

igb_main.c 파일의 8599 번째 라인에서 정의되었습니다.

8600 {
8601  struct igb_ring *rx_ring = q_vector->rx.ring;
8602  struct sk_buff *skb = rx_ring->skb;
8603  unsigned int total_bytes = 0, total_packets = 0;
8604  u16 cleaned_count = igb_desc_unused(rx_ring);
8605 
8606  /* don't service user (AVB) queues */
8607  if (rx_ring->queue_index < 2)
8608  return true;
8609 
8610  do {
8611  union e1000_adv_rx_desc *rx_desc;
8612 
8613  /* return some buffers to hardware, one at a time is too slow */
8614  if (cleaned_count >= IGB_RX_BUFFER_WRITE) {
8615  igb_alloc_rx_buffers(rx_ring, cleaned_count);
8616  cleaned_count = 0;
8617  }
8618 
8619  rx_desc = IGB_RX_DESC(rx_ring, rx_ring->next_to_clean);
8620 
8621  if (!igb_test_staterr(rx_desc, E1000_RXD_STAT_DD))
8622  break;
8623 
8624  /*
8625  * This memory barrier is needed to keep us from reading
8626  * any other fields out of the rx_desc until we know the
8627  * RXD_STAT_DD bit is set
8628  */
8629  rmb();
8630 
8631  /* retrieve a buffer from the ring */
8632  skb = igb_fetch_rx_buffer(rx_ring, rx_desc, skb);
8633 
8634  /* exit if we failed to retrieve a buffer */
8635  if (!skb)
8636  break;
8637 
8638  cleaned_count++;
8639 
8640  /* fetch next buffer in frame if non-eop */
8641  if (igb_is_non_eop(rx_ring, rx_desc))
8642  continue;
8643 
8644  /* verify the packet layout is correct */
8645  if (igb_cleanup_headers(rx_ring, rx_desc, skb)) {
8646  skb = NULL;
8647  continue;
8648  }
8649 
8650  /* probably a little skewed due to removing CRC */
8651  total_bytes += skb->len;
8652 
8653  /* populate checksum, timestamp, VLAN, and protocol */
8654  igb_process_skb_fields(rx_ring, rx_desc, skb);
8655 
8656 #ifndef IGB_NO_LRO
8657  if (igb_can_lro(rx_ring, rx_desc, skb))
8658  igb_lro_receive(q_vector, skb);
8659  else
8660 #endif
8661 #ifdef HAVE_VLAN_RX_REGISTER
8662  igb_receive_skb(q_vector, skb);
8663 #else
8664  napi_gro_receive(&q_vector->napi, skb);
8665 #endif
8666 #ifndef NETIF_F_GRO
8667 
8668  netdev_ring(rx_ring)->last_rx = jiffies;
8669 #endif
8670 
8671  /* reset skb pointer */
8672  skb = NULL;
8673 
8674  /* update budget accounting */
8675  total_packets++;
8676  } while (likely(total_packets < budget));
8677 
8678  /* place incomplete frames back on ring for completion */
8679  rx_ring->skb = skb;
8680 
8681  rx_ring->rx_stats.packets += total_packets;
8682  rx_ring->rx_stats.bytes += total_bytes;
8683  q_vector->rx.total_packets += total_packets;
8684  q_vector->rx.total_bytes += total_bytes;
8685 
8686  if (cleaned_count)
8687  igb_alloc_rx_buffers(rx_ring, cleaned_count);
8688 
8689 #ifndef IGB_NO_LRO
8690  igb_lro_flush_all(q_vector);
8691 
8692 #endif /* IGB_NO_LRO */
8693  return (total_packets < budget);
8694 }
#define E1000_RXD_STAT_DD
static bool igb_cleanup_headers(struct igb_ring *rx_ring, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb)
Definition: igb_main.c:8567
static void igb_lro_receive(struct igb_q_vector *q_vector, struct sk_buff *new_skb)
Definition: igb_main.c:8015
u8 queue_index
Definition: igb.h:380
Definition: igb.h:365
#define rmb()
Definition: e1000_osdep.h:63
u16 next_to_clean
Definition: igb.h:384
static u16 igb_desc_unused(const struct igb_ring *ring)
Definition: igb.h:481
#define netdev_ring(ring)
Definition: igb.h:469
static void igb_process_skb_fields(struct igb_ring *rx_ring, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb)
Definition: igb_main.c:8167
u_int16_t u16
Definition: e1000_osdep.h:51
struct sk_buff * skb
Definition: igb.h:400
#define likely(_x)
Definition: kcompat.h:255
#define IGB_RX_BUFFER_WRITE
Definition: igb.h:212
#define IGB_RX_DESC(R, i)
Definition: igb.h:456
#define napi_gro_receive(_napi, _skb)
Definition: kcompat.h:212
static __le32 igb_test_staterr(union e1000_adv_rx_desc *rx_desc, const u32 stat_err_bits)
Definition: igb.h:474
void igb_alloc_rx_buffers(struct igb_ring *rx_ring, u16 cleaned_count)
Definition: igb_main.c:8782
static struct sk_buff * igb_fetch_rx_buffer(struct igb_ring *rx_ring, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb)
Definition: igb_main.c:7608
struct igb_rx_queue_stats rx_stats
Definition: igb.h:395
struct napi_struct napi
Definition: igb.h:421
static void igb_lro_flush_all(struct igb_q_vector *q_vector)
Definition: igb_main.c:7902
static bool igb_is_non_eop(struct igb_ring *rx_ring, union e1000_adv_rx_desc *rx_desc)
Definition: igb_main.c:8264
#define NULL
Null pointer value.
static bool igb_can_lro(struct igb_ring *rx_ring, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb)
Definition: igb_main.c:7800

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_clean_rx_ring ( struct igb_ring rx_ring)

igb_clean_rx_ring - Free Rx Buffers per Queue : ring to free buffers from

igb_main.c 파일의 4278 번째 라인에서 정의되었습니다.

4279 {
4280  unsigned long size;
4281  u16 i;
4282 
4283  if (!rx_ring->rx_buffer_info)
4284  return;
4285 
4286 #ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
4287  if (rx_ring->skb)
4288  dev_kfree_skb(rx_ring->skb);
4289  rx_ring->skb = NULL;
4290 
4291 #endif
4292  /* Free all the Rx ring sk_buffs */
4293  for (i = 0; i < rx_ring->count; i++) {
4294  struct igb_rx_buffer *buffer_info = &rx_ring->rx_buffer_info[i];
4295 #ifdef CONFIG_IGB_DISABLE_PACKET_SPLIT
4296  if (buffer_info->dma) {
4297  dma_unmap_single(rx_ring->dev,
4298  buffer_info->dma,
4299  rx_ring->rx_buffer_len,
4300  DMA_FROM_DEVICE);
4301  buffer_info->dma = 0;
4302  }
4303 
4304  if (buffer_info->skb) {
4305  dev_kfree_skb(buffer_info->skb);
4306  buffer_info->skb = NULL;
4307  }
4308 #else
4309  if (!buffer_info->page)
4310  continue;
4311 
4312  dma_unmap_page(rx_ring->dev,
4313  buffer_info->dma,
4314  PAGE_SIZE,
4315  DMA_FROM_DEVICE);
4316  __free_page(buffer_info->page);
4317 
4318  buffer_info->page = NULL;
4319 #endif
4320  }
4321 
4322  size = sizeof(struct igb_rx_buffer) * rx_ring->count;
4323  memset(rx_ring->rx_buffer_info, 0, size);
4324 
4325  /* Zero out the descriptor ring */
4326  memset(rx_ring->desc, 0, rx_ring->size);
4327 
4328  rx_ring->next_to_alloc = 0;
4329  rx_ring->next_to_clean = 0;
4330  rx_ring->next_to_use = 0;
4331 }
u16 count
Definition: igb.h:379
struct device * dev
Definition: igb.h:368
struct igb_rx_buffer * rx_buffer_info
Definition: igb.h:371
unsigned int size
Definition: igb.h:377
u16 next_to_clean
Definition: igb.h:384
u16 next_to_use
Definition: igb.h:385
u_int16_t u16
Definition: e1000_osdep.h:51
struct sk_buff * skb
Definition: igb.h:400
void * desc
Definition: igb.h:373
int size
u16 next_to_alloc
Definition: igb.h:386
dma_addr_t dma
Definition: igb.h:321
struct page * page
Definition: igb.h:325
#define NULL
Null pointer value.

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static bool igb_clean_tx_irq ( struct igb_q_vector q_vector)
static

igb_clean_tx_irq - Reclaim resources after transmit completes : pointer to q_vector containing needed info returns TRUE if ring is completely cleaned

igb_main.c 파일의 7274 번째 라인에서 정의되었습니다.

7275 {
7276  struct igb_adapter *adapter = q_vector->adapter;
7277  struct igb_ring *tx_ring = q_vector->tx.ring;
7278  struct igb_tx_buffer *tx_buffer;
7279  union e1000_adv_tx_desc *tx_desc;
7280  unsigned int total_bytes = 0, total_packets = 0;
7281  unsigned int budget = q_vector->tx.work_limit;
7282  unsigned int i = tx_ring->next_to_clean;
7283 
7284  if (test_bit(__IGB_DOWN, &adapter->state))
7285  return true;
7286 
7287  /* don't service user (AVB) queues */
7288  if (tx_ring->queue_index < 2)
7289  return true;
7290 
7291  tx_buffer = &tx_ring->tx_buffer_info[i];
7292  tx_desc = IGB_TX_DESC(tx_ring, i);
7293  i -= tx_ring->count;
7294 
7295  do {
7296  union e1000_adv_tx_desc *eop_desc = tx_buffer->next_to_watch;
7297 
7298  /* if next_to_watch is not set then there is no work pending */
7299  if (!eop_desc)
7300  break;
7301 
7302  /* prevent any other reads prior to eop_desc */
7303  read_barrier_depends();
7304 
7305  /* if DD is not set pending work has not been completed */
7306  if (!(eop_desc->wb.status & cpu_to_le32(E1000_TXD_STAT_DD)))
7307  break;
7308 
7309  /* clear next_to_watch to prevent false hangs */
7310  tx_buffer->next_to_watch = NULL;
7311 
7312  /* update the statistics for this packet */
7313  total_bytes += tx_buffer->bytecount;
7314  total_packets += tx_buffer->gso_segs;
7315 
7316  /* free the skb */
7317  dev_kfree_skb_any(tx_buffer->skb);
7318 
7319  /* unmap skb header data */
7320  dma_unmap_single(tx_ring->dev,
7321  dma_unmap_addr(tx_buffer, dma),
7322  dma_unmap_len(tx_buffer, len),
7323  DMA_TO_DEVICE);
7324 
7325  /* clear tx_buffer data */
7326  tx_buffer->skb = NULL;
7327  dma_unmap_len_set(tx_buffer, len, 0);
7328 
7329  /* clear last DMA location and unmap remaining buffers */
7330  while (tx_desc != eop_desc) {
7331  tx_buffer++;
7332  tx_desc++;
7333  i++;
7334  if (unlikely(!i)) {
7335  i -= tx_ring->count;
7336  tx_buffer = tx_ring->tx_buffer_info;
7337  tx_desc = IGB_TX_DESC(tx_ring, 0);
7338  }
7339 
7340  /* unmap any remaining paged data */
7341  if (dma_unmap_len(tx_buffer, len)) {
7342  dma_unmap_page(tx_ring->dev,
7343  dma_unmap_addr(tx_buffer, dma),
7344  dma_unmap_len(tx_buffer, len),
7345  DMA_TO_DEVICE);
7346  dma_unmap_len_set(tx_buffer, len, 0);
7347  }
7348  }
7349 
7350  /* move us one more past the eop_desc for start of next pkt */
7351  tx_buffer++;
7352  tx_desc++;
7353  i++;
7354  if (unlikely(!i)) {
7355  i -= tx_ring->count;
7356  tx_buffer = tx_ring->tx_buffer_info;
7357  tx_desc = IGB_TX_DESC(tx_ring, 0);
7358  }
7359 
7360  /* issue prefetch for next Tx descriptor */
7361  prefetch(tx_desc);
7362 
7363  /* update budget accounting */
7364  budget--;
7365  } while (likely(budget));
7366 
7367  netdev_tx_completed_queue(txring_txq(tx_ring),
7368  total_packets, total_bytes);
7369 
7370  i += tx_ring->count;
7371  tx_ring->next_to_clean = i;
7372  tx_ring->tx_stats.bytes += total_bytes;
7373  tx_ring->tx_stats.packets += total_packets;
7374  q_vector->tx.total_bytes += total_bytes;
7375  q_vector->tx.total_packets += total_packets;
7376 
7377 #ifdef DEBUG
7378  if (test_bit(IGB_RING_FLAG_TX_DETECT_HANG, &tx_ring->flags) &&
7379  !(adapter->disable_hw_reset && adapter->tx_hang_detected)) {
7380 #else
7381  if (test_bit(IGB_RING_FLAG_TX_DETECT_HANG, &tx_ring->flags)) {
7382 #endif
7383  struct e1000_hw *hw = &adapter->hw;
7384 
7385  /* Detect a transmit hang in hardware, this serializes the
7386  * check with the clearing of time_stamp and movement of i
7387  */
7388  clear_bit(IGB_RING_FLAG_TX_DETECT_HANG, &tx_ring->flags);
7389  if (tx_buffer->next_to_watch &&
7390  time_after(jiffies, tx_buffer->time_stamp +
7391  (adapter->tx_timeout_factor * HZ))
7392  && !(E1000_READ_REG(hw, E1000_STATUS) &
7393  E1000_STATUS_TXOFF)) {
7394 
7395  /* detected Tx unit hang */
7396 #ifdef DEBUG
7397  adapter->tx_hang_detected = TRUE;
7398  if (adapter->disable_hw_reset) {
7399  DPRINTK(DRV, WARNING,
7400  "Deactivating netdev watchdog timer\n");
7401  if (del_timer(&netdev_ring(tx_ring)->watchdog_timer))
7402  dev_put(netdev_ring(tx_ring));
7403 #ifndef HAVE_NET_DEVICE_OPS
7404  netdev_ring(tx_ring)->tx_timeout = NULL;
7405 #endif
7406  }
7407 #endif /* DEBUG */
7408  dev_err(tx_ring->dev,
7409  "Detected Tx Unit Hang\n"
7410  " Tx Queue <%d>\n"
7411  " TDH <%x>\n"
7412  " TDT <%x>\n"
7413  " next_to_use <%x>\n"
7414  " next_to_clean <%x>\n"
7415  "buffer_info[next_to_clean]\n"
7416  " time_stamp <%lx>\n"
7417  " next_to_watch <%p>\n"
7418  " jiffies <%lx>\n"
7419  " desc.status <%x>\n",
7420  tx_ring->queue_index,
7421  E1000_READ_REG(hw, E1000_TDH(tx_ring->reg_idx)),
7422  readl(tx_ring->tail),
7423  tx_ring->next_to_use,
7424  tx_ring->next_to_clean,
7425  tx_buffer->time_stamp,
7426  tx_buffer->next_to_watch,
7427  jiffies,
7428  tx_buffer->next_to_watch->wb.status);
7429  if (netif_is_multiqueue(netdev_ring(tx_ring)))
7430  netif_stop_subqueue(netdev_ring(tx_ring),
7431  ring_queue_index(tx_ring));
7432  else
7433  netif_stop_queue(netdev_ring(tx_ring));
7434 
7435  /* we are about to reset, no point in enabling stuff */
7436  return true;
7437  }
7438  }
7439 
7440 #define TX_WAKE_THRESHOLD (DESC_NEEDED * 2)
7441  if (unlikely(total_packets &&
7442  netif_carrier_ok(netdev_ring(tx_ring)) &&
7443  igb_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD)) {
7444  /* Make sure that anybody stopping the queue after this
7445  * sees the new next_to_clean.
7446  */
7447  smp_mb();
7448  if (netif_is_multiqueue(netdev_ring(tx_ring))) {
7449  if (__netif_subqueue_stopped(netdev_ring(tx_ring),
7450  ring_queue_index(tx_ring)) &&
7451  !(test_bit(__IGB_DOWN, &adapter->state))) {
7452  netif_wake_subqueue(netdev_ring(tx_ring),
7453  ring_queue_index(tx_ring));
7454  tx_ring->tx_stats.restart_queue++;
7455  }
7456  } else {
7457  if (netif_queue_stopped(netdev_ring(tx_ring)) &&
7458  !(test_bit(__IGB_DOWN, &adapter->state))) {
7459  netif_wake_queue(netdev_ring(tx_ring));
7460  tx_ring->tx_stats.restart_queue++;
7461  }
7462  }
7463  }
7464 
7465  return !!budget;
7466 }
u16 count
Definition: igb.h:379
struct e1000_hw hw
Definition: igb.h:594
struct device * dev
Definition: igb.h:368
u8 reg_idx
Definition: igb.h:381
#define E1000_TXD_STAT_DD
struct sk_buff * skb
Definition: igb.h:310
#define E1000_TDH(_n)
Definition: e1000_regs.h:210
unsigned int total_packets
Definition: igb.h:359
struct igb_adapter * adapter
Definition: igb.h:411
u8 queue_index
Definition: igb.h:380
Definition: igb.h:365
u16 next_to_clean
Definition: igb.h:384
u16 work_limit
Definition: igb.h:360
static u16 igb_desc_unused(const struct igb_ring *ring)
Definition: igb.h:481
#define IGB_TX_DESC(R, i)
Definition: igb.h:458
u64 restart_queue
Definition: igb.h:333
#define netdev_ring(ring)
Definition: igb.h:469
u16 next_to_use
Definition: igb.h:385
unsigned long time_stamp
Definition: igb.h:309
#define prefetch(x)
Definition: e1000_osdep.h:65
#define DPRINTK(nlevel, klevel, fmt, args...)
Definition: igb.h:75
#define likely(_x)
Definition: kcompat.h:255
unsigned int bytecount
Definition: igb.h:311
unsigned long state
Definition: igb.h:537
struct igb_ring_container rx tx
Definition: igb.h:419
#define E1000_STATUS
Definition: e1000_regs.h:29
void __iomem * tail
Definition: igb.h:375
struct e1000_adv_tx_desc::@37 wb
union e1000_adv_tx_desc * next_to_watch
Definition: igb.h:308
struct igb_tx_buffer * tx_buffer_info
Definition: igb.h:370
u16 gso_segs
Definition: igb.h:312
#define ring_queue_index(ring)
Definition: igb.h:470
#define TRUE
Definition: maap_log.h:91
unsigned long flags
Definition: igb.h:374
#define unlikely(_x)
Definition: kcompat.h:254
struct igb_ring * ring
Definition: igb.h:357
struct igb_tx_queue_stats tx_stats
Definition: igb.h:391
unsigned int total_bytes
Definition: igb.h:358
u8 tx_timeout_factor
Definition: igb.h:573
#define E1000_STATUS_TXOFF
#define NULL
Null pointer value.
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
#define TX_WAKE_THRESHOLD

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_clean_tx_ring ( struct igb_ring tx_ring)
static

igb_clean_tx_ring - Free Tx Buffers : ring to be cleaned

igb_main.c 파일의 4198 번째 라인에서 정의되었습니다.

4199 {
4200  struct igb_tx_buffer *buffer_info;
4201  unsigned long size;
4202  u16 i;
4203 
4204  if (!tx_ring->tx_buffer_info)
4205  return;
4206  /* Free all the Tx ring sk_buffs */
4207 
4208  for (i = 0; i < tx_ring->count; i++) {
4209  buffer_info = &tx_ring->tx_buffer_info[i];
4210  igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
4211  }
4212 
4213  netdev_tx_reset_queue(txring_txq(tx_ring));
4214 
4215  size = sizeof(struct igb_tx_buffer) * tx_ring->count;
4216  memset(tx_ring->tx_buffer_info, 0, size);
4217 
4218  /* Zero out the descriptor ring */
4219  memset(tx_ring->desc, 0, tx_ring->size);
4220 
4221  tx_ring->next_to_use = 0;
4222  tx_ring->next_to_clean = 0;
4223 }
u16 count
Definition: igb.h:379
unsigned int size
Definition: igb.h:377
u16 next_to_clean
Definition: igb.h:384
u16 next_to_use
Definition: igb.h:385
u_int16_t u16
Definition: e1000_osdep.h:51
void * desc
Definition: igb.h:373
int size
struct igb_tx_buffer * tx_buffer_info
Definition: igb.h:370
void igb_unmap_and_free_tx_resource(struct igb_ring *ring, struct igb_tx_buffer *tx_buffer)
Definition: igb_main.c:4172

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static bool igb_cleanup_headers ( struct igb_ring rx_ring,
union e1000_adv_rx_desc rx_desc,
struct sk_buff *  skb 
)
static

igb_cleanup_headers - Correct corrupted or empty headers : rx descriptor ring packet is being transacted on : pointer to the EOP Rx descriptor : pointer to current skb being fixed

Address the case where we are pulling data in on pages only and as such no data is present in the skb header.

In addition if skb is not at least 60 bytes we need to pad it so that it is large enough to qualify as a valid Ethernet frame.

Returns true if an error was encountered and skb was freed.

igb_main.c 파일의 8567 번째 라인에서 정의되었습니다.

8570 {
8571 
8572  if (unlikely((igb_test_staterr(rx_desc,
8574  struct net_device *netdev = rx_ring->netdev;
8575 
8576  if (!(netdev->features & NETIF_F_RXALL)) {
8577  dev_kfree_skb_any(skb);
8578  return true;
8579  }
8580  }
8581 
8582  /* place header in linear portion of buffer */
8583  if (skb_is_nonlinear(skb))
8584  igb_pull_tail(rx_ring, rx_desc, skb);
8585 
8586  /* if skb_pad returns an error the skb was freed */
8587  if (unlikely(skb->len < 60)) {
8588  int pad_len = 60 - skb->len;
8589 
8590  if (skb_pad(skb, pad_len))
8591  return true;
8592  __skb_put(skb, pad_len);
8593  }
8594 
8595  return false;
8596 }
static void igb_pull_tail(struct igb_ring *rx_ring, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb)
Definition: igb_main.c:8506
struct net_device * netdev
Definition: igb.h:367
#define E1000_RXDEXT_ERR_FRAME_ERR_MASK
static __le32 igb_test_staterr(union e1000_adv_rx_desc *rx_desc, const u32 stat_err_bits)
Definition: igb.h:474
#define unlikely(_x)
Definition: kcompat.h:254

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_clear_interrupt_scheme ( struct igb_adapter adapter)
static

igb_clear_interrupt_scheme - reset the device to a state of no interrupts

This function resets the device so that it has 0 rx queues, tx queues, and MSI-X interrupts allocated.

igb_main.c 파일의 855 번째 라인에서 정의되었습니다.

856 {
857  igb_free_q_vectors(adapter);
859 }
static void igb_free_q_vectors(struct igb_adapter *adapter)
Definition: igb_main.c:835
static void igb_reset_interrupt_capability(struct igb_adapter *adapter)
Definition: igb_main.c:811

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_clear_vf_vfta ( struct igb_adapter adapter,
u32  vf 
)
static

igb_main.c 파일의 6572 번째 라인에서 정의되었습니다.

6573 {
6574  struct e1000_hw *hw = &adapter->hw;
6575  u32 pool_mask, reg, vid;
6576  u16 vlan_default;
6577  int i;
6578 
6579  pool_mask = 1 << (E1000_VLVF_POOLSEL_SHIFT + vf);
6580 
6581  /* Find the vlan filter for this id */
6582  for (i = 0; i < E1000_VLVF_ARRAY_SIZE; i++) {
6583  reg = E1000_READ_REG(hw, E1000_VLVF(i));
6584 
6585  /* remove the vf from the pool */
6586  reg &= ~pool_mask;
6587 
6588  /* if pool is empty then remove entry from vfta */
6589  if (!(reg & E1000_VLVF_POOLSEL_MASK) &&
6590  (reg & E1000_VLVF_VLANID_ENABLE)) {
6591  reg = 0;
6592  vid = reg & E1000_VLVF_VLANID_MASK;
6593  igb_vfta_set(adapter, vid, FALSE);
6594  }
6595 
6596  E1000_WRITE_REG(hw, E1000_VLVF(i), reg);
6597  }
6598 
6599  adapter->vf_data[vf].vlans_enabled = 0;
6600 
6601  vlan_default = adapter->vf_data[vf].default_vf_vlan_id;
6602  if (vlan_default)
6603  igb_vlvf_set(adapter, vlan_default, true, vf);
6604 }
struct e1000_hw hw
Definition: igb.h:594
#define E1000_VLVF_ARRAY_SIZE
Definition: e1000_82575.h:434
#define E1000_VLVF(_n)
Definition: e1000_regs.h:514
struct e1000_dev_spec_vf vf
Definition: e1000_hw.h:772
#define E1000_VLVF_VLANID_ENABLE
Definition: e1000_82575.h:439
u_int16_t u16
Definition: e1000_osdep.h:51
u16 vlans_enabled
Definition: igb.h:145
s32 igb_vlvf_set(struct igb_adapter *adapter, u32 vid, bool add, u32 vf)
Definition: igb_main.c:6606
#define FALSE
Definition: maap_log.h:94
struct vf_data_storage * vf_data
Definition: igb.h:615
u16 default_vf_vlan_id
Definition: igb.h:144
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_VLVF_POOLSEL_MASK
Definition: e1000_82575.h:437
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_VLVF_POOLSEL_SHIFT
Definition: e1000_82575.h:436
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
static void igb_vfta_set(struct igb_adapter *adapter, u32 vid, bool add)
Definition: igb_main.c:350
#define E1000_VLVF_VLANID_MASK
Definition: e1000_82575.h:435

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_close ( struct net_device *  netdev)
static

igb_main.c 파일의 3485 번째 라인에서 정의되었습니다.

3486 {
3487  return __igb_close(netdev, false);
3488 }
static int __igb_close(struct net_device *netdev, bool suspending)
Definition: igb_main.c:3452

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_close_file ( struct inode *  inode,
struct file *  file 
)
static

igb_main.c 파일의 10776 번째 라인에서 정의되었습니다.

10777 {
10778  struct igb_private_data *igb_priv = file->private_data;
10779  struct igb_adapter *adapter = NULL;
10780  int err = 0;
10781  struct igb_user_page *userpage;
10782 
10783  if (igb_priv == NULL) {
10784  printk("cannot find private data!\n");
10785  return -ENOENT;
10786  }
10787 
10788  adapter = igb_priv->adapter;
10789  if (adapter == NULL)
10790  goto out;
10791 
10792  mutex_lock(&adapter->lock);
10793 
10794  adapter->uring_tx_init &= ~igb_priv->uring_tx_init;
10795  adapter->uring_rx_init &= ~igb_priv->uring_rx_init;
10796 
10797  userpage = igb_priv->userpages;
10798 
10799  while (userpage != NULL) {
10800  dma_unmap_page(pci_dev_to_dev(adapter->pdev),
10801  userpage->page_dma,
10802  PAGE_SIZE,
10803  DMA_FROM_DEVICE);
10804 
10805  put_page(userpage->page);
10806 
10807  /* take the page out of our list and free it */
10808  if (userpage->prev)
10809  userpage->prev->next = userpage->next;
10810 
10811  if (userpage->next)
10812  userpage->next->prev = userpage->prev;
10813 
10814  if (userpage == igb_priv->userpages)
10815  igb_priv->userpages = userpage->next;
10816 
10817  vfree(userpage);
10818  userpage = igb_priv->userpages;
10819  }
10820  mutex_unlock(&adapter->lock);
10821 
10822  err = igb_unbind(file);
10823 out:
10824  file->private_data = NULL;
10825  kfree(igb_priv);
10826  return err;
10827 }
static jack_default_audio_sample_t ** out
Definition: jack_listener.c:75
struct igb_adapter * adapter
Definition: igb.h:929
int err
struct mutex lock
Definition: igb.h:693
dma_addr_t page_dma
Definition: igb.h:52
struct pci_dev * pdev
Definition: igb.h:582
u32 uring_rx_init
Definition: igb.h:934
u32 uring_tx_init
Definition: igb.h:584
u32 uring_tx_init
Definition: igb.h:933
u32 uring_rx_init
Definition: igb.h:585
static int igb_unbind(struct file *file)
Definition: igb_main.c:10312
struct page * page
Definition: igb.h:51
struct igb_user_page * next
Definition: igb.h:50
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
struct igb_user_page * userpages
Definition: igb.h:931
struct igb_user_page * prev
Definition: igb.h:49
#define NULL
Null pointer value.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static void igb_configure ( struct igb_adapter adapter)
static

igb_configure - configure the hardware for RX and TX : private board structure

igb_main.c 파일의 1579 번째 라인에서 정의되었습니다.

1580 {
1581  struct net_device *netdev = adapter->netdev;
1582  int i;
1583 
1584  igb_get_hw_control(adapter);
1585  igb_set_rx_mode(netdev);
1586 
1587  igb_restore_vlan(adapter);
1588 
1589  igb_setup_tctl(adapter);
1590  igb_setup_mrqc(adapter);
1591  igb_setup_rctl(adapter);
1592 
1593  igb_configure_tx(adapter);
1594  igb_configure_rx(adapter);
1595 
1596  e1000_rx_fifo_flush_82575(&adapter->hw);
1597 #ifdef CONFIG_NETDEVICES_MULTIQUEUE
1598  if (adapter->num_tx_queues > 1)
1599  netdev->features |= NETIF_F_MULTI_QUEUE;
1600  else
1601  netdev->features &= ~NETIF_F_MULTI_QUEUE;
1602 #endif
1603 
1604  /* call igb_desc_unused which always leaves
1605  * at least 1 descriptor unused to make sure
1606  * next_to_use != next_to_clean
1607  */
1608  /* AVB specific */
1609  for (i = 0; i < adapter->num_rx_queues; i++) {
1610  struct igb_ring *ring = adapter->rx_ring[i];
1611 
1613  }
1614 }
static void igb_get_hw_control(struct igb_adapter *adapter)
Definition: igb_main.c:1564
void e1000_rx_fifo_flush_82575(struct e1000_hw *hw)
Definition: e1000_82575.c:2144
static void igb_configure_tx(struct igb_adapter *)
Definition: igb_main.c:3641
struct e1000_hw hw
Definition: igb.h:594
struct net_device * netdev
Definition: igb.h:535
Definition: igb.h:365
static u16 igb_desc_unused(const struct igb_ring *ring)
Definition: igb.h:481
int num_tx_queues
Definition: igb.h:547
static void igb_setup_mrqc(struct igb_adapter *)
Definition: igb_main.c:3721
int num_rx_queues
Definition: igb.h:551
static void igb_configure_rx(struct igb_adapter *)
Definition: igb_main.c:4117
void igb_setup_tctl(struct igb_adapter *adapter)
Definition: igb_main.c:3558
struct igb_ring * rx_ring[IGB_MAX_RX_QUEUES]
Definition: igb.h:552
static void igb_set_rx_mode(struct net_device *)
Definition: igb_main.c:4567
void igb_setup_rctl(struct igb_adapter *adapter)
Definition: igb_main.c:3859
void igb_alloc_rx_buffers(struct igb_ring *rx_ring, u16 cleaned_count)
Definition: igb_main.c:8782
static void igb_restore_vlan(struct igb_adapter *)
Definition: igb_main.c:9125

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_configure_lli ( struct igb_adapter adapter)
static

igb_main.c 파일의 492 번째 라인에서 정의되었습니다.

493 {
494  struct e1000_hw *hw = &adapter->hw;
495  u16 port;
496 
497  /* LLI should only be enabled for MSI-X or MSI interrupts */
498  if (!adapter->msix_entries && !(adapter->flags & IGB_FLAG_HAS_MSI))
499  return;
500 
501  if (adapter->lli_port) {
502  /* use filter 0 for port */
503  port = htons((u16)adapter->lli_port);
505  (port | E1000_IMIR_PORT_IM_EN));
508  }
509 
510  if (adapter->flags & IGB_FLAG_LLI_PUSH) {
511  /* use filter 1 for push flag */
516  }
517 
518  if (adapter->lli_size) {
519  /* use filter 2 for size */
523  (adapter->lli_size | E1000_IMIREXT_CTRL_BP));
524  }
525 
526 }
struct msix_entry * msix_entries
Definition: igb.h:541
struct e1000_hw hw
Definition: igb.h:594
u32 lli_size
Definition: igb.h:620
#define E1000_IMIREXT_CTRL_BP
Definition: e1000_82575.h:179
#define E1000_IMIR_PORT_IM_EN
Definition: e1000_82575.h:170
#define E1000_IMIREXT_CTRL_PSH
Definition: e1000_82575.h:175
#define IGB_FLAG_HAS_MSI
Definition: igb.h:712
unsigned int flags
Definition: igb.h:538
#define IGB_FLAG_LLI_PUSH
Definition: igb.h:714
int port
u_int16_t u16
Definition: e1000_osdep.h:51
#define E1000_IMIR_PORT_BP
Definition: e1000_82575.h:171
#define E1000_IMIREXT_SIZE_BP
Definition: e1000_82575.h:172
#define E1000_IMIREXT(_i)
Definition: e1000_regs.h:478
u32 lli_port
Definition: igb.h:619
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_IMIR(_i)
Definition: e1000_regs.h:477

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_configure_msix ( struct igb_adapter adapter)
static

igb_configure_msix - Configure MSI-X hardware

igb_configure_msix sets up the hardware to properly generate MSI-X interrupts.

igb_main.c 파일의 641 번째 라인에서 정의되었습니다.

642 {
643  u32 tmp;
644  int i, vector = 0;
645  struct e1000_hw *hw = &adapter->hw;
646 
647  adapter->eims_enable_mask = 0;
648 
649  /* set vector for other causes, i.e. link changes */
650  switch (hw->mac.type) {
651  case e1000_82575:
652  tmp = E1000_READ_REG(hw, E1000_CTRL_EXT);
653  /* enable MSI-X PBA support*/
654  tmp |= E1000_CTRL_EXT_PBA_CLR;
655 
656  /* Auto-Mask interrupts upon ICR read. */
657  tmp |= E1000_CTRL_EXT_EIAME;
658  tmp |= E1000_CTRL_EXT_IRCA;
659 
661 
662  /* enable msix_other interrupt */
663  E1000_WRITE_REG_ARRAY(hw, E1000_MSIXBM(0), vector++,
665  adapter->eims_other = E1000_EIMS_OTHER;
666 
667  break;
668 
669  case e1000_82576:
670  case e1000_82580:
671  case e1000_i350:
672  case e1000_i354:
673  case e1000_i210:
674  case e1000_i211:
675  /* Turn on MSI-X capability first, or our settings
676  * won't stick. And it will take days to debug.
677  */
681 
682  /* enable msix_other interrupt */
683  adapter->eims_other = 1 << vector;
684  tmp = (vector++ | E1000_IVAR_VALID) << 8;
685 
687  break;
688  default:
689  /* do nothing, since nothing else supports MSI-X */
690  break;
691  } /* switch (hw->mac.type) */
692 
693  adapter->eims_enable_mask |= adapter->eims_other;
694 
695  for (i = 0; i < adapter->num_q_vectors; i++)
696  igb_assign_vector(adapter->q_vector[i], vector++);
697 
698  E1000_WRITE_FLUSH(hw);
699 }
unsigned int num_q_vectors
Definition: igb.h:540
#define E1000_WRITE_REG_ARRAY(hw, reg, idx, val)
Definition: e1000_osdep.h:100
#define E1000_CTRL_EXT_EIAME
Definition: e1000_defines.h:81
struct e1000_hw hw
Definition: igb.h:594
#define E1000_CTRL_EXT_IRCA
Definition: e1000_defines.h:82
#define E1000_IVAR_VALID
Definition: e1000_defines.h:97
#define E1000_CTRL_EXT_PBA_CLR
Definition: e1000_defines.h:85
#define E1000_EIMS_OTHER
#define E1000_CTRL_EXT
Definition: e1000_regs.h:32
u32 eims_other
Definition: igb.h:609
static void igb_assign_vector(struct igb_q_vector *q_vector, int msix_vector)
Definition: igb_main.c:555
#define E1000_GPIE
Definition: e1000_regs.h:72
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
#define E1000_MSIXBM(_i)
Definition: e1000_regs.h:480
struct igb_q_vector * q_vector[MAX_Q_VECTORS]
Definition: igb.h:607
#define E1000_WRITE_FLUSH(a)
Definition: e1000_osdep.h:127
#define E1000_IVAR_MISC
Definition: e1000_regs.h:74
u32 eims_enable_mask
Definition: igb.h:608
#define E1000_GPIE_PBA
#define E1000_GPIE_NSICR
Definition: e1000_defines.h:98
#define E1000_GPIE_EIAME
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_GPIE_MSIX_MODE
Definition: e1000_defines.h:99
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_configure_rx ( struct igb_adapter adapter)
static

igb_configure_rx - Configure receive Unit after Reset : board private structure

Configure the Rx unit of the MAC after a reset.

igb_main.c 파일의 4117 번째 라인에서 정의되었습니다.

4118 {
4119  int i;
4120 
4121  /* set UTA to appropriate mode */
4122  igb_set_uta(adapter);
4123 
4124  /* set the correct pool for the PF default MAC address in entry 0 */
4125  igb_rar_set_qsel(adapter, adapter->hw.mac.addr, 0,
4126  adapter->vfs_allocated_count);
4127 
4128  /* Setup the HW Rx Head and Tail Descriptor Pointers and
4129  * the Base and Length of the Rx Descriptor Ring
4130  */
4131  for (i = 0; i < adapter->num_rx_queues; i++)
4132  igb_configure_rx_ring(adapter, adapter->rx_ring[i]);
4133 }
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
static void igb_rar_set_qsel(struct igb_adapter *, u8 *, u32, u8)
Definition: igb_main.c:4478
u8 addr[ETH_ADDR_LEN]
Definition: e1000_hw.h:599
int num_rx_queues
Definition: igb.h:551
struct e1000_mac_info mac
Definition: e1000_hw.h:762
static void igb_set_uta(struct igb_adapter *adapter)
Definition: igb_main.c:7106
struct igb_ring * rx_ring[IGB_MAX_RX_QUEUES]
Definition: igb.h:552
void igb_configure_rx_ring(struct igb_adapter *adapter, struct igb_ring *ring)
Definition: igb_main.c:4025

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_configure_rx_ring ( struct igb_adapter adapter,
struct igb_ring ring 
)

igb_configure_rx_ring - Configure a receive ring after Reset : board private structure : receive ring to be configured

Configure the Rx unit of the MAC after a reset.

igb_main.c 파일의 4025 번째 라인에서 정의되었습니다.

4027 {
4028  struct e1000_hw *hw = &adapter->hw;
4029  u64 rdba = ring->dma;
4030  int reg_idx = ring->reg_idx;
4031  u32 srrctl = 0, rxdctl = 0;
4032 
4033 #ifdef CONFIG_IGB_DISABLE_PACKET_SPLIT
4034  /*
4035  * RLPML prevents us from receiving a frame larger than max_frame so
4036  * it is safe to just set the rx_buffer_len to max_frame without the
4037  * risk of an skb over panic.
4038  */
4039  ring->rx_buffer_len = max_t(u32, adapter->max_frame_size,
4041 
4042 #endif
4043  /* disable the queue */
4044  E1000_WRITE_REG(hw, E1000_RXDCTL(reg_idx), 0);
4045 
4046  /* Set DMA base address registers */
4047  E1000_WRITE_REG(hw, E1000_RDBAL(reg_idx),
4048  rdba & 0x00000000ffffffffULL);
4049  E1000_WRITE_REG(hw, E1000_RDBAH(reg_idx), rdba >> 32);
4050  E1000_WRITE_REG(hw, E1000_RDLEN(reg_idx),
4051  ring->count * sizeof(union e1000_adv_rx_desc));
4052 
4053  /* initialize head and tail */
4054  ring->tail = hw->hw_addr + E1000_RDT(reg_idx);
4055  E1000_WRITE_REG(hw, E1000_RDH(reg_idx), 0);
4056  writel(0, ring->tail);
4057 
4058  /* reset next-to- use/clean to place SW in sync with hardwdare */
4059  ring->next_to_clean = 0;
4060  ring->next_to_use = 0;
4061 #ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
4062  ring->next_to_alloc = 0;
4063 
4064 #endif
4065  /* set descriptor configuration */
4066 #ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
4069 #else /* CONFIG_IGB_DISABLE_PACKET_SPLIT */
4070  srrctl = ALIGN(ring->rx_buffer_len, 1024) >>
4072 #endif /* CONFIG_IGB_DISABLE_PACKET_SPLIT */
4074 #ifdef HAVE_PTP_1588_CLOCK
4075  if (hw->mac.type >= e1000_82580)
4076  srrctl |= E1000_SRRCTL_TIMESTAMP;
4077 #endif /* HAVE_PTP_1588_CLOCK */
4078  /*
4079  * We should set the drop enable bit if:
4080  * SR-IOV is enabled
4081  * or
4082  * Flow Control is disabled and number of RX queues > 1
4083  *
4084  * This allows us to avoid head of line blocking for security
4085  * and performance reasons.
4086  */
4087  if (adapter->vfs_allocated_count ||
4088  (adapter->num_rx_queues > 1 &&
4089  (hw->fc.requested_mode == e1000_fc_none ||
4091  srrctl |= E1000_SRRCTL_DROP_EN;
4092 
4093  /* turn off header split */
4094  srrctl &= 0xF3FFFFFF;
4095  srrctl |= 0x02000000;
4096 
4097  E1000_WRITE_REG(hw, E1000_SRRCTL(reg_idx), srrctl);
4098 
4099  /* set filtering for VMDQ pools */
4100  igb_set_vmolr(adapter, reg_idx & 0x7, true);
4101 
4102  rxdctl |= IGB_RX_PTHRESH;
4103  rxdctl |= IGB_RX_HTHRESH << 8;
4104  rxdctl |= IGB_RX_WTHRESH << 16;
4105 
4106  /* enable receive descriptor fetching */
4107  rxdctl |= E1000_RXDCTL_QUEUE_ENABLE;
4108  E1000_WRITE_REG(hw, E1000_RXDCTL(reg_idx), rxdctl);
4109 }
u16 count
Definition: igb.h:379
#define E1000_RDBAH(_n)
Definition: e1000_regs.h:187
enum e1000_fc_mode requested_mode
Definition: e1000_hw.h:707
#define E1000_SRRCTL_BSIZEPKT_SHIFT
Definition: e1000_82575.h:114
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
u8 reg_idx
Definition: igb.h:381
static void igb_set_vmolr(struct igb_adapter *adapter, int vfn, bool aupe)
Definition: igb_main.c:3986
#define E1000_SRRCTL_BSIZEHDRSIZE_SHIFT
Definition: e1000_82575.h:116
#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF
Definition: e1000_82575.h:118
#define E1000_RDT(_n)
Definition: e1000_regs.h:198
#define MAXIMUM_ETHERNET_VLAN_SIZE
Definition: igb.h:184
u32 max_frame_size
Definition: igb.h:579
u16 next_to_clean
Definition: igb.h:384
#define IGB_RX_HTHRESH
Definition: igb.h:177
#define E1000_RDLEN(_n)
Definition: e1000_regs.h:189
int num_rx_queues
Definition: igb.h:551
struct e1000_mac_info mac
Definition: e1000_hw.h:762
u16 next_to_use
Definition: igb.h:385
enum e1000_mac_type type
Definition: e1000_hw.h:602
#define IGB_RX_HDR_LEN
Definition: igb.h:196
u8 __iomem * hw_addr
Definition: e1000_hw.h:758
#define IGB_RX_PTHRESH
Definition: igb.h:176
struct e1000_fc_info fc
Definition: e1000_hw.h:763
#define E1000_RDH(_n)
Definition: e1000_regs.h:193
#define IGB_RX_BUFSZ
Definition: igb.h:198
#define E1000_RDBAL(_n)
Definition: e1000_regs.h:185
void __iomem * tail
Definition: igb.h:375
u16 next_to_alloc
Definition: igb.h:386
#define IGB_RX_WTHRESH
Definition: igb.h:180
#define E1000_RXDCTL_QUEUE_ENABLE
Definition: e1000_82575.h:339
dma_addr_t dma
Definition: igb.h:376
#define E1000_SRRCTL_DROP_EN
Definition: e1000_82575.h:125
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_SRRCTL_TIMESTAMP
Definition: e1000_82575.h:124
#define E1000_SRRCTL(_n)
Definition: e1000_regs.h:191
u_int32_t u32
Definition: e1000_osdep.h:50
u_int64_t u64
Definition: e1000_osdep.h:49
#define E1000_RXDCTL(_n)
Definition: e1000_regs.h:200

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_configure_tx ( struct igb_adapter adapter)
static

igb_configure_tx - Configure transmit Unit after Reset : board private structure

Configure the Tx unit of the MAC after a reset.

igb_main.c 파일의 3641 번째 라인에서 정의되었습니다.

3642 {
3643  int i;
3644 
3645  for (i = 0; i < adapter->num_tx_queues; i++)
3646  igb_configure_tx_ring(adapter, adapter->tx_ring[i]);
3647 }
void igb_configure_tx_ring(struct igb_adapter *adapter, struct igb_ring *ring)
Definition: igb_main.c:3604
int num_tx_queues
Definition: igb.h:547
struct igb_ring * tx_ring[IGB_MAX_TX_QUEUES]
Definition: igb.h:548

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_configure_tx_ring ( struct igb_adapter adapter,
struct igb_ring ring 
)

igb_configure_tx_ring - Configure transmit ring after Reset : board private structure : tx ring to configure

Configure a transmit ring after a reset.

igb_main.c 파일의 3604 번째 라인에서 정의되었습니다.

3606 {
3607  struct e1000_hw *hw = &adapter->hw;
3608  u32 txdctl = 0;
3609  u64 tdba = ring->dma;
3610  int reg_idx = ring->reg_idx;
3611 
3612  /* disable the queue */
3613  E1000_WRITE_REG(hw, E1000_TXDCTL(reg_idx), 0);
3614  E1000_WRITE_FLUSH(hw);
3615  mdelay(10);
3616 
3617  E1000_WRITE_REG(hw, E1000_TDLEN(reg_idx),
3618  ring->count * sizeof(union e1000_adv_tx_desc));
3619  E1000_WRITE_REG(hw, E1000_TDBAL(reg_idx),
3620  tdba & 0x00000000ffffffffULL);
3621  E1000_WRITE_REG(hw, E1000_TDBAH(reg_idx), tdba >> 32);
3622 
3623  ring->tail = hw->hw_addr + E1000_TDT(reg_idx);
3624  E1000_WRITE_REG(hw, E1000_TDH(reg_idx), 0);
3625  writel(0, ring->tail);
3626 
3627  txdctl |= IGB_TX_PTHRESH;
3628  txdctl |= IGB_TX_HTHRESH << 8;
3629  txdctl |= igb_tx_wthresh(adapter) << 16;
3630 
3631  txdctl |= E1000_TXDCTL_QUEUE_ENABLE;
3632  E1000_WRITE_REG(hw, E1000_TXDCTL(reg_idx), txdctl);
3633 }
u16 count
Definition: igb.h:379
struct e1000_hw hw
Definition: igb.h:594
#define E1000_TXDCTL(_n)
Definition: e1000_regs.h:217
u8 reg_idx
Definition: igb.h:381
#define E1000_TXDCTL_QUEUE_ENABLE
Definition: e1000_82575.h:333
#define E1000_TDT(_n)
Definition: e1000_regs.h:215
#define E1000_TDH(_n)
Definition: e1000_regs.h:210
u8 __iomem * hw_addr
Definition: e1000_hw.h:758
void __iomem * tail
Definition: igb.h:375
#define E1000_WRITE_FLUSH(a)
Definition: e1000_osdep.h:127
static u32 igb_tx_wthresh(struct igb_adapter *adapter)
Definition: igb_main.c:3580
dma_addr_t dma
Definition: igb.h:376
#define IGB_TX_PTHRESH
Definition: igb.h:178
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_TDBAL(_n)
Definition: e1000_regs.h:204
#define E1000_TDBAH(_n)
Definition: e1000_regs.h:206
#define E1000_TDLEN(_n)
Definition: e1000_regs.h:208
u_int32_t u32
Definition: e1000_osdep.h:50
u_int64_t u64
Definition: e1000_osdep.h:49
#define IGB_TX_HTHRESH
Definition: igb.h:179

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

int igb_del_mac_filter ( struct igb_adapter adapter,
u8 addr,
u16  queue 
)

igb_main.c 파일의 9696 번째 라인에서 정의되었습니다.

9697 {
9698  /* search table for addr, if found, set to 0 and sync */
9699  int i;
9700  struct e1000_hw *hw = &adapter->hw;
9701 
9702  if (is_zero_ether_addr(addr))
9703  return 0;
9704  for (i = 0; i < hw->mac.rar_entry_count; i++) {
9705  if (!ether_addr_equal(addr, adapter->mac_table[i].addr) &&
9706  adapter->mac_table[i].queue == queue) {
9707  adapter->mac_table[i].state = IGB_MAC_STATE_MODIFIED;
9708  memset(adapter->mac_table[i].addr, 0, ETH_ALEN);
9709  adapter->mac_table[i].queue = 0;
9710  igb_sync_mac_table(adapter);
9711  return 0;
9712  }
9713  }
9714  return -ENOMEM;
9715 }
void igb_sync_mac_table(struct igb_adapter *adapter)
Definition: igb_main.c:4454
u16 queue
Definition: igb.h:447
struct e1000_hw hw
Definition: igb.h:594
u8 addr[ETH_ALEN]
Definition: igb.h:446
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define ETH_ALEN
#define IGB_MAC_STATE_MODIFIED
Definition: igb.h:451
struct igb_mac_addr * mac_table
Definition: igb.h:630
u16 rar_entry_count
Definition: e1000_hw.h:623
u16 state
Definition: igb.h:448

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static void igb_disable_mdd ( struct igb_adapter adapter)
static

igb_disable_mdd - board private structure

Disable MDD behavior in the HW

igb_main.c 파일의 908 번째 라인에서 정의되었습니다.

909 {
910  struct e1000_hw *hw = &adapter->hw;
911  u32 reg;
912 
913  if ((hw->mac.type != e1000_i350) &&
914  (hw->mac.type != e1000_i354))
915  return;
916 
917  reg = E1000_READ_REG(hw, E1000_DTXCTL);
918  reg &= (~E1000_DTXCTL_MDP_EN);
919  E1000_WRITE_REG(hw, E1000_DTXCTL, reg);
920 }
struct e1000_hw hw
Definition: igb.h:594
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define E1000_DTXCTL_MDP_EN
Definition: e1000_82575.h:458
enum e1000_mac_type type
Definition: e1000_hw.h:602
#define E1000_DTXCTL
Definition: e1000_regs.h:255
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_dma_err_task ( struct work_struct *  work)
static

igb_main.c 파일의 4973 번째 라인에서 정의되었습니다.

4974 {
4975  struct igb_adapter *adapter = container_of(work,
4976  struct igb_adapter,
4977  dma_err_task);
4978  int vf;
4979  struct e1000_hw *hw = &adapter->hw;
4980  struct net_device *netdev = adapter->netdev;
4981  u32 hgptc;
4982  u32 ciaa, ciad;
4983 
4984  hgptc = E1000_READ_REG(hw, E1000_HGPTC);
4985  if (hgptc) /* If incrementing then no need for the check below */
4986  goto dma_timer_reset;
4987  /*
4988  * Check to see if a bad DMA write target from an errant or
4989  * malicious VF has caused a PCIe error. If so then we can
4990  * issue a VFLR to the offending VF(s) and then resume without
4991  * requesting a full slot reset.
4992  */
4993 
4994  for (vf = 0; vf < adapter->vfs_allocated_count; vf++) {
4995  ciaa = (vf << 16) | 0x80000000;
4996  /* 32 bit read so align, we really want status at offset 6 */
4997  ciaa |= PCI_COMMAND;
4998  E1000_WRITE_REG(hw, E1000_CIAA, ciaa);
4999  ciad = E1000_READ_REG(hw, E1000_CIAD);
5000  ciaa &= 0x7FFFFFFF;
5001  /* disable debug mode asap after reading data */
5002  E1000_WRITE_REG(hw, E1000_CIAA, ciaa);
5003  /* Get the upper 16 bits which will be the PCI status reg */
5004  ciad >>= 16;
5005  if (ciad & (PCI_STATUS_REC_MASTER_ABORT |
5006  PCI_STATUS_REC_TARGET_ABORT |
5007  PCI_STATUS_SIG_SYSTEM_ERROR)) {
5008  netdev_err(netdev, "VF %d suffered error\n", vf);
5009  /* Issue VFLR */
5010  ciaa = (vf << 16) | 0x80000000;
5011  ciaa |= 0xA8;
5012  E1000_WRITE_REG(hw, E1000_CIAA, ciaa);
5013  ciad = 0x00008000; /* VFLR */
5014  E1000_WRITE_REG(hw, E1000_CIAD, ciad);
5015  ciaa &= 0x7FFFFFFF;
5016  E1000_WRITE_REG(hw, E1000_CIAA, ciaa);
5017  }
5018  }
5019 dma_timer_reset:
5020  /* Reset the timer */
5021  if (!test_bit(__IGB_DOWN, &adapter->state))
5022  mod_timer(&adapter->dma_err_timer,
5023  round_jiffies(jiffies + HZ / 10));
5024 }
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
struct net_device * netdev
Definition: igb.h:535
#define E1000_HGPTC
Definition: e1000_regs.h:405
#define E1000_CIAD
Definition: e1000_regs.h:427
unsigned long state
Definition: igb.h:537
#define E1000_CIAA
Definition: e1000_regs.h:426
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
struct work_struct dma_err_task
Definition: igb.h:571
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
struct timer_list dma_err_timer
Definition: igb.h:555

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_dma_err_timer ( struct timer_list *  timer)
static

igb_dma_err_timer - Timer Call-back : pointer to adapter cast into an unsigned long

igb_main.c 파일의 5031 번째 라인에서 정의되었습니다.

5035 {
5036  struct igb_adapter *adapter;
5037 
5038 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
5039  adapter = container_of(timer, struct igb_adapter, dma_err_timer);
5040 #else
5041  adapter = (struct igb_adapter *)data;
5042 #endif
5043 
5044  /* Do the rest outside of interrupt context */
5045  schedule_work(&adapter->dma_err_task);
5046 }
struct work_struct dma_err_task
Definition: igb.h:571
struct timer_list dma_err_timer
Definition: igb.h:555

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_down ( struct igb_adapter adapter)

igb_main.c 파일의 1875 번째 라인에서 정의되었습니다.

1876 {
1877  struct net_device *netdev = adapter->netdev;
1878  struct e1000_hw *hw = &adapter->hw;
1879  u32 tctl, rctl;
1880  int i;
1881 
1882  /* signal that we're down so the interrupt handler does not
1883  * reschedule our watchdog timer
1884  */
1885  set_bit(__IGB_DOWN, &adapter->state);
1886 
1887  /* disable receives in the hardware */
1888  rctl = E1000_READ_REG(hw, E1000_RCTL);
1890  /* flush and sleep below */
1891 
1892  netif_carrier_off(netdev);
1893  netif_tx_stop_all_queues(netdev);
1894 
1895  /* disable transmits in the hardware */
1896  tctl = E1000_READ_REG(hw, E1000_TCTL);
1897  tctl &= ~E1000_TCTL_EN;
1898  E1000_WRITE_REG(hw, E1000_TCTL, tctl);
1899  /* flush both disables and wait for them to finish */
1900  E1000_WRITE_FLUSH(hw);
1901  usleep_range(10000, 20000);
1902 
1903  for (i = 0; i < adapter->num_q_vectors; i++)
1904  napi_disable(&(adapter->q_vector[i]->napi));
1905 
1906  igb_irq_disable(adapter);
1907 
1908  adapter->flags &= ~IGB_FLAG_NEED_LINK_UPDATE;
1909 
1910  del_timer_sync(&adapter->watchdog_timer);
1911  if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA)
1912  del_timer_sync(&adapter->dma_err_timer);
1913  del_timer_sync(&adapter->phy_info_timer);
1914 
1915  /* record the stats before reset*/
1916  igb_update_stats(adapter);
1917 
1918  adapter->link_speed = 0;
1919  adapter->link_duplex = 0;
1920 
1921 #ifdef HAVE_PCI_ERS
1922  if (!pci_channel_offline(adapter->pdev))
1923  igb_reset(adapter);
1924 #else
1925  igb_reset(adapter);
1926 #endif
1927  igb_clean_all_tx_rings(adapter);
1928  igb_clean_all_rx_rings(adapter);
1929 #ifdef IGB_DCA
1930  /* since we reset the hardware DCA settings were cleared */
1931  igb_setup_dca(adapter);
1932 #endif
1933 }
unsigned int num_q_vectors
Definition: igb.h:540
struct e1000_hw hw
Definition: igb.h:594
#define E1000_TCTL_EN
#define E1000_RCTL_EN
#define E1000_RCTL
Definition: e1000_regs.h:61
static void igb_irq_disable(struct igb_adapter *adapter)
Definition: igb_main.c:1438
struct net_device * netdev
Definition: igb.h:535
void igb_update_stats(struct igb_adapter *adapter)
Definition: igb_main.c:5908
struct pci_dev * pdev
Definition: igb.h:582
unsigned int flags
Definition: igb.h:538
static void igb_clean_all_rx_rings(struct igb_adapter *)
Definition: igb_main.c:4337
struct timer_list phy_info_timer
Definition: igb.h:556
struct timer_list watchdog_timer
Definition: igb.h:554
static void igb_clean_all_tx_rings(struct igb_adapter *)
Definition: igb_main.c:4229
u16 link_duplex
Definition: igb.h:562
unsigned long state
Definition: igb.h:537
struct igb_q_vector * q_vector[MAX_Q_VECTORS]
Definition: igb.h:607
#define IGB_FLAG_NEED_LINK_UPDATE
Definition: igb.h:724
#define E1000_WRITE_FLUSH(a)
Definition: e1000_osdep.h:127
#define E1000_TCTL
Definition: e1000_regs.h:75
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
void igb_reset(struct igb_adapter *adapter)
Definition: igb_main.c:1967
u16 link_speed
Definition: igb.h:561
u_int32_t u32
Definition: e1000_osdep.h:50
struct napi_struct napi
Definition: igb.h:421
#define IGB_FLAG_DETECT_BAD_DMA
Definition: igb.h:719
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
struct timer_list dma_err_timer
Definition: igb.h:555

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_enable_mas ( struct igb_adapter adapter)

igb_enable_mas - Media Autosense re-enable after swap

: adapter struct

igb_main.c 파일의 1950 번째 라인에서 정의되었습니다.

1951 {
1952  struct e1000_hw *hw = &adapter->hw;
1953  u32 connsw;
1954 
1955  connsw = E1000_READ_REG(hw, E1000_CONNSW);
1956 
1957  /* configure for SerDes media detect */
1958  if ((hw->phy.media_type == e1000_media_type_copper) &&
1959  (!(connsw & E1000_CONNSW_SERDESD))) {
1960  connsw |= E1000_CONNSW_ENRGSRC;
1961  connsw |= E1000_CONNSW_AUTOSENSE_EN;
1962  E1000_WRITE_REG(hw, E1000_CONNSW, connsw);
1963  E1000_WRITE_FLUSH(hw);
1964  }
1965 }
#define E1000_CONNSW_ENRGSRC
struct e1000_hw hw
Definition: igb.h:594
struct e1000_phy_info phy
Definition: e1000_hw.h:764
enum e1000_media_type media_type
Definition: e1000_hw.h:657
#define E1000_WRITE_FLUSH(a)
Definition: e1000_osdep.h:127
#define E1000_CONNSW
Definition: e1000_regs.h:52
#define E1000_CONNSW_AUTOSENSE_EN
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_CONNSW_SERDESD
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
static void igb_enable_mdd ( struct igb_adapter adapter)
static

igb_enable_mdd - board private structure

Enable the HW to detect malicious driver and sends an interrupt to the driver.

igb_main.c 파일의 929 번째 라인에서 정의되었습니다.

930 {
931  struct e1000_hw *hw = &adapter->hw;
932  u32 reg;
933 
934  /* Only available on i350 device */
935  if (hw->mac.type != e1000_i350)
936  return;
937 
938  reg = E1000_READ_REG(hw, E1000_DTXCTL);
939  reg |= E1000_DTXCTL_MDP_EN;
940  E1000_WRITE_REG(hw, E1000_DTXCTL, reg);
941 }
struct e1000_hw hw
Definition: igb.h:594
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define E1000_DTXCTL_MDP_EN
Definition: e1000_82575.h:458
enum e1000_mac_type type
Definition: e1000_hw.h:602
#define E1000_DTXCTL
Definition: e1000_regs.h:255
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void __exit igb_exit_module ( void  )
static

igb_exit_module - Driver Exit Cleanup Routine

igb_exit_module is called just before the driver is removed from memory.

igb_main.c 파일의 428 번째 라인에서 정의되었습니다.

429 {
430 #ifdef IGB_DCA
431  dca_unregister_notify(&dca_notifier);
432 #endif
433 #ifdef USE_REBOOT_NOTIFIER
434  unregister_reboot_notifier(&igb_notifier_reboot);
435 #endif
436  misc_deregister(&igb_miscdev);
437  pci_unregister_driver(&igb_driver);
438 
439 #ifdef IGB_HWMON
440 /* only compile IGB_PROCFS if IGB_HWMON is not defined */
441 #else
442 #ifdef IGB_PROCFS
443  igb_procfs_topdir_exit();
444 #endif /* IGB_PROCFS */
445 #endif /* IGB_HWMON */
446 }
static struct miscdevice igb_miscdev
Definition: igb_main.c:316
static struct pci_driver igb_driver
Definition: igb_main.c:322

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static struct sk_buff* igb_fetch_rx_buffer ( struct igb_ring rx_ring,
union e1000_adv_rx_desc rx_desc,
struct sk_buff *  skb 
)
static

igb_main.c 파일의 7608 번째 라인에서 정의되었습니다.

7611 {
7612  struct igb_rx_buffer *rx_buffer;
7613  struct page *page;
7614 
7615  rx_buffer = &rx_ring->rx_buffer_info[rx_ring->next_to_clean];
7616 
7617  page = rx_buffer->page;
7618  prefetchw(page);
7619 
7620  if (likely(!skb)) {
7621  void *page_addr = page_address(page) +
7622  rx_buffer->page_offset;
7623 
7624  /* prefetch first cache line of first page */
7625  prefetch(page_addr);
7626 #if L1_CACHE_BYTES < 128
7627  prefetch(page_addr + L1_CACHE_BYTES);
7628 #endif
7629 
7630  /* allocate a skb to store the frags */
7631  skb = netdev_alloc_skb_ip_align(rx_ring->netdev,
7632  IGB_RX_HDR_LEN);
7633  if (unlikely(!skb)) {
7634  rx_ring->rx_stats.alloc_failed++;
7635  return NULL;
7636  }
7637 
7638  /*
7639  * we will be copying header into skb->data in
7640  * pskb_may_pull so it is in our interest to prefetch
7641  * it now to avoid a possible cache miss
7642  */
7643  prefetchw(skb->data);
7644  }
7645 
7646  /* we are reusing so sync this buffer for CPU use */
7647  dma_sync_single_range_for_cpu(rx_ring->dev,
7648  rx_buffer->dma,
7649  rx_buffer->page_offset,
7650  IGB_RX_BUFSZ,
7651  DMA_FROM_DEVICE);
7652 
7653  /* pull page into skb */
7654  if (igb_add_rx_frag(rx_ring, rx_buffer, rx_desc, skb)) {
7655  /* hand second half of page back to the ring */
7656  igb_reuse_rx_page(rx_ring, rx_buffer);
7657  } else {
7658  /* we are not reusing the buffer so unmap it */
7659  dma_unmap_page(rx_ring->dev, rx_buffer->dma,
7660  PAGE_SIZE, DMA_FROM_DEVICE);
7661  }
7662 
7663  /* clear contents of rx_buffer */
7664  rx_buffer->page = NULL;
7665 
7666  return skb;
7667 }
u64 alloc_failed
Definition: igb.h:341
struct device * dev
Definition: igb.h:368
struct igb_rx_buffer * rx_buffer_info
Definition: igb.h:371
u16 next_to_clean
Definition: igb.h:384
#define IGB_RX_HDR_LEN
Definition: igb.h:196
#define prefetch(x)
Definition: e1000_osdep.h:65
static void igb_reuse_rx_page(struct igb_ring *rx_ring, struct igb_rx_buffer *old_buff)
Definition: igb_main.c:7500
#define likely(_x)
Definition: kcompat.h:255
struct net_device * netdev
Definition: igb.h:367
#define IGB_RX_BUFSZ
Definition: igb.h:198
static bool igb_add_rx_frag(struct igb_ring *rx_ring, struct igb_rx_buffer *rx_buffer, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb)
Definition: igb_main.c:7567
dma_addr_t dma
Definition: igb.h:321
struct igb_rx_queue_stats rx_stats
Definition: igb.h:395
#define unlikely(_x)
Definition: kcompat.h:254
u32 page_offset
Definition: igb.h:326
struct page * page
Definition: igb.h:325
#define NULL
Null pointer value.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_find_vlvf_entry ( struct igb_adapter adapter,
int  vid 
)
static

igb_main.c 파일의 6793 번째 라인에서 정의되었습니다.

6794 {
6795  struct e1000_hw *hw = &adapter->hw;
6796  int i;
6797  u32 reg;
6798 
6799  /* Find the vlan filter for this id */
6800  for (i = 0; i < E1000_VLVF_ARRAY_SIZE; i++) {
6801  reg = E1000_READ_REG(hw, E1000_VLVF(i));
6802  if ((reg & E1000_VLVF_VLANID_ENABLE) &&
6803  vid == (reg & E1000_VLVF_VLANID_MASK))
6804  break;
6805  }
6806 
6807  if (i >= E1000_VLVF_ARRAY_SIZE)
6808  i = -1;
6809 
6810  return i;
6811 }
struct e1000_hw hw
Definition: igb.h:594
#define E1000_VLVF_ARRAY_SIZE
Definition: e1000_82575.h:434
#define E1000_VLVF(_n)
Definition: e1000_regs.h:514
#define E1000_VLVF_VLANID_ENABLE
Definition: e1000_82575.h:439
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
#define E1000_VLVF_VLANID_MASK
Definition: e1000_82575.h:435

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static netdev_features_t igb_fix_features ( struct net_device *  netdev,
netdev_features_t  features 
)
static

igb_main.c 파일의 2130 번째 라인에서 정의되었습니다.

2132 {
2133  /*
2134  * Since there is no support for separate tx vlan accel
2135  * enabled make sure tx flag is cleared if rx is.
2136  */
2137 #ifdef NETIF_F_HW_VLAN_CTAG_RX
2138  if (!(features & NETIF_F_HW_VLAN_CTAG_RX))
2139  features &= ~NETIF_F_HW_VLAN_CTAG_TX;
2140 #else
2141  if (!(features & NETIF_F_HW_VLAN_RX))
2142  features &= ~NETIF_F_HW_VLAN_TX;
2143 #endif
2144 
2145  /* If Rx checksum is disabled, then LRO should also be disabled */
2146  if (!(features & NETIF_F_RXCSUM))
2147  features &= ~NETIF_F_LRO;
2148 
2149  return features;
2150 }
#define NETIF_F_LRO
Definition: kcompat.h:220
const char features[]
Definition: feature_tests.c:2
static void igb_free_all_rx_resources ( struct igb_adapter adapter)
static

igb_free_all_rx_resources - Free Rx Resources for All Queues : board private structure

Free all receive software resources

igb_main.c 파일의 4266 번째 라인에서 정의되었습니다.

4267 {
4268  int i;
4269 
4270  for (i = 0; i < adapter->num_rx_queues; i++)
4271  igb_free_rx_resources(adapter->rx_ring[i]);
4272 }
int num_rx_queues
Definition: igb.h:551
struct igb_ring * rx_ring[IGB_MAX_RX_QUEUES]
Definition: igb.h:552
void igb_free_rx_resources(struct igb_ring *rx_ring)
Definition: igb_main.c:4243

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_free_all_tx_resources ( struct igb_adapter adapter)
static

igb_free_all_tx_resources - Free Tx Resources for All Queues : board private structure

Free all transmit software resources

igb_main.c 파일의 4164 번째 라인에서 정의되었습니다.

4165 {
4166  int i;
4167 
4168  for (i = 0; i < adapter->num_tx_queues; i++)
4169  igb_free_tx_resources(adapter->tx_ring[i]);
4170 }
int num_tx_queues
Definition: igb.h:547
void igb_free_tx_resources(struct igb_ring *tx_ring)
Definition: igb_main.c:4141
struct igb_ring * tx_ring[IGB_MAX_TX_QUEUES]
Definition: igb.h:548

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_free_irq ( struct igb_adapter adapter)
static

igb_main.c 파일의 1419 번째 라인에서 정의되었습니다.

1420 {
1421  if (adapter->msix_entries) {
1422  int vector = 0, i;
1423 
1424  free_irq(adapter->msix_entries[vector++].vector, adapter);
1425 
1426  for (i = 0; i < adapter->num_q_vectors; i++)
1427  free_irq(adapter->msix_entries[vector++].vector,
1428  adapter->q_vector[i]);
1429  } else {
1430  free_irq(adapter->pdev->irq, adapter);
1431  }
1432 }
unsigned int num_q_vectors
Definition: igb.h:540
struct msix_entry * msix_entries
Definition: igb.h:541
struct pci_dev * pdev
Definition: igb.h:582
struct igb_q_vector * q_vector[MAX_Q_VECTORS]
Definition: igb.h:607

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_free_q_vector ( struct igb_adapter adapter,
int  v_idx 
)
static

igb_free_q_vector - Free memory allocated for specific interrupt vector : board private structure to initialize : Index of vector to be freed

This function frees the memory allocated to the q_vector.

igb_main.c 파일의 767 번째 라인에서 정의되었습니다.

768 {
769  struct igb_q_vector *q_vector = adapter->q_vector[v_idx];
770 
771  adapter->q_vector[v_idx] = NULL;
772 
773  /* igb_get_stats64() might access the rings on this vector,
774  * we must wait a grace period before freeing it.
775  */
776  kfree_rcu(q_vector, rcu);
777 
778 #ifndef IGB_NO_LRO
779  __skb_queue_purge(&q_vector->lrolist.active);
780 #endif
781 }
struct rcu_head rcu
Definition: igb.h:425
struct igb_lro_list lrolist
Definition: igb.h:423
struct igb_q_vector * q_vector[MAX_Q_VECTORS]
Definition: igb.h:607
struct sk_buff_head active
Definition: igb.h:247
#define NULL
Null pointer value.

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_free_q_vectors ( struct igb_adapter adapter)
static

igb_free_q_vectors - Free memory allocated for interrupt vectors : board private structure to initialize

This function frees the memory allocated to the q_vectors. In addition if NAPI is enabled it will delete any references to the NAPI struct prior to freeing the q_vector.

igb_main.c 파일의 835 번째 라인에서 정의되었습니다.

836 {
837  int v_idx = adapter->num_q_vectors;
838 
839  adapter->num_tx_queues = 0;
840  adapter->num_rx_queues = 0;
841  adapter->num_q_vectors = 0;
842 
843  while (v_idx--) {
844  igb_reset_q_vector(adapter, v_idx);
845  igb_free_q_vector(adapter, v_idx);
846  }
847 }
unsigned int num_q_vectors
Definition: igb.h:540
int num_tx_queues
Definition: igb.h:547
int num_rx_queues
Definition: igb.h:551
static void igb_free_q_vector(struct igb_adapter *adapter, int v_idx)
Definition: igb_main.c:767
static void igb_reset_q_vector(struct igb_adapter *adapter, int v_idx)
Definition: igb_main.c:791

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_free_rx_resources ( struct igb_ring rx_ring)

igb_free_rx_resources - Free Rx Resources : ring to clean the resources from

Free all receive software resources

igb_main.c 파일의 4243 번째 라인에서 정의되었습니다.

4244 {
4245  igb_clean_rx_ring(rx_ring);
4246 
4247  vfree(rx_ring->rx_buffer_info);
4248  rx_ring->rx_buffer_info = NULL;
4249 
4250  /* if not set, then don't free */
4251  if (!rx_ring->desc)
4252  return;
4253 
4254  dma_free_coherent(rx_ring->dev, rx_ring->size,
4255  rx_ring->desc, rx_ring->dma);
4256 
4257  rx_ring->desc = NULL;
4258 }
struct device * dev
Definition: igb.h:368
struct igb_rx_buffer * rx_buffer_info
Definition: igb.h:371
unsigned int size
Definition: igb.h:377
void igb_clean_rx_ring(struct igb_ring *rx_ring)
Definition: igb_main.c:4278
void * desc
Definition: igb.h:373
dma_addr_t dma
Definition: igb.h:376
#define NULL
Null pointer value.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_free_tx_resources ( struct igb_ring tx_ring)

igb_free_tx_resources - Free Tx Resources per Queue : Tx descriptor ring for a specific queue

Free all transmit software resources

igb_main.c 파일의 4141 번째 라인에서 정의되었습니다.

4142 {
4143  igb_clean_tx_ring(tx_ring);
4144 
4145  vfree(tx_ring->tx_buffer_info);
4146  tx_ring->tx_buffer_info = NULL;
4147 
4148  /* if not set, then don't free */
4149  if (!tx_ring->desc)
4150  return;
4151 
4152  dma_free_coherent(tx_ring->dev, tx_ring->size,
4153  tx_ring->desc, tx_ring->dma);
4154 
4155  tx_ring->desc = NULL;
4156 }
struct device * dev
Definition: igb.h:368
unsigned int size
Definition: igb.h:377
void * desc
Definition: igb.h:373
struct igb_tx_buffer * tx_buffer_info
Definition: igb.h:370
dma_addr_t dma
Definition: igb.h:376
static void igb_clean_tx_ring(struct igb_ring *)
Definition: igb_main.c:4198
#define NULL
Null pointer value.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_full_sync_mac_table ( struct igb_adapter adapter)

igb_main.c 파일의 4445 번째 라인에서 정의되었습니다.

4446 {
4447  struct e1000_hw *hw = &adapter->hw;
4448  int i;
4449 
4450  for (i = 0; i < hw->mac.rar_entry_count; i++)
4451  igb_rar_set(adapter, i);
4452 }
struct e1000_hw hw
Definition: igb.h:594
struct e1000_mac_info mac
Definition: e1000_hw.h:762
u16 rar_entry_count
Definition: e1000_hw.h:623
void igb_rar_set(struct igb_adapter *adapter, u32 index)
Definition: igb_main.c:2589

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static unsigned int igb_get_headlen ( unsigned char *  data,
unsigned int  max_len 
)
static

igb_get_headlen - determine size of header for LRO/GRO : pointer to the start of the headers : total length of section to find headers in

This function is meant to determine the length of headers that will be recognized by hardware for LRO, and GRO offloads. The main motivation of doing this is to only perform one pull for IPv4 TCP packets so that we can do basic things like calculating the gso_size based on the average data per packet.

igb_main.c 파일의 8394 번째 라인에서 정의되었습니다.

8396 {
8397  union {
8398  unsigned char *network;
8399  /* l2 headers */
8400  struct ethhdr *eth;
8401  struct vlan_hdr *vlan;
8402  /* l3 headers */
8403  struct iphdr *ipv4;
8404  struct ipv6hdr *ipv6;
8405  } hdr;
8406  __be16 protocol;
8407  u8 nexthdr = 0; /* default to not TCP */
8408  u8 hlen;
8409 
8410  /* this should never happen, but better safe than sorry */
8411  if (max_len < ETH_HLEN)
8412  return max_len;
8413 
8414  /* initialize network frame pointer */
8415  hdr.network = data;
8416 
8417  /* set first protocol and move network header forward */
8418  protocol = hdr.eth->h_proto;
8419  hdr.network += ETH_HLEN;
8420 
8421  /* handle any vlan tag if present */
8422  if (protocol == htons(ETH_P_8021Q)) {
8423  if ((hdr.network - data) > (max_len - VLAN_HLEN))
8424  return max_len;
8425 
8426  protocol = hdr.vlan->h_vlan_encapsulated_proto;
8427  hdr.network += VLAN_HLEN;
8428  }
8429 
8430  /* handle L3 protocols */
8431  if (protocol == htons(ETH_P_IP)) {
8432  if ((hdr.network - data) > (max_len - sizeof(struct iphdr)))
8433  return max_len;
8434 
8435  /* access ihl as a u8 to avoid unaligned access on ia64 */
8436  hlen = (hdr.network[0] & 0x0F) << 2;
8437 
8438  /* verify hlen meets minimum size requirements */
8439  if (hlen < sizeof(struct iphdr))
8440  return hdr.network - data;
8441 
8442  /* record next protocol if header is present */
8443  if (!(hdr.ipv4->frag_off & htons(IP_OFFSET)))
8444  nexthdr = hdr.ipv4->protocol;
8445 #ifdef NETIF_F_TSO6
8446  } else if (protocol == htons(ETH_P_IPV6)) {
8447  if ((hdr.network - data) > (max_len - sizeof(struct ipv6hdr)))
8448  return max_len;
8449 
8450  /* record next protocol */
8451  nexthdr = hdr.ipv6->nexthdr;
8452  hlen = sizeof(struct ipv6hdr);
8453 #endif /* NETIF_F_TSO6 */
8454  } else {
8455  return hdr.network - data;
8456  }
8457 
8458  /* relocate pointer to start of L4 header */
8459  hdr.network += hlen;
8460 
8461  /* finally sort out TCP */
8462  if (nexthdr == IPPROTO_TCP) {
8463  if ((hdr.network - data) > (max_len - sizeof(struct tcphdr)))
8464  return max_len;
8465 
8466  /* access doff as a u8 to avoid unaligned access on ia64 */
8467  hlen = (hdr.network[12] & 0xF0) >> 2;
8468 
8469  /* verify hlen meets minimum size requirements */
8470  if (hlen < sizeof(struct tcphdr))
8471  return hdr.network - data;
8472 
8473  hdr.network += hlen;
8474  } else if (nexthdr == IPPROTO_UDP) {
8475  if ((hdr.network - data) > (max_len - sizeof(struct udphdr)))
8476  return max_len;
8477 
8478  hdr.network += sizeof(struct udphdr);
8479  }
8480 
8481  /*
8482  * If everything has gone correctly hdr.network should be the
8483  * data section of the packet and will be the end of the header.
8484  * If not then it probably represents the end of the last recognized
8485  * header.
8486  */
8487  if ((hdr.network - data) < max_len)
8488  return hdr.network - data;
8489  else
8490  return max_len;
8491 }
#define VLAN_HLEN
Definition: kcompat.h:292
u_int8_t u8
Definition: e1000_osdep.h:52
#define IP_OFFSET
Definition: kcompat.h:367
#define ETH_P_8021Q
Definition: kcompat.h:148
#define vlan_hdr
Definition: kcompat.h:349

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_get_hw_control ( struct igb_adapter adapter)
static

igb_get_hw_control - get control of the h/w from f/w : address of board private structure

igb_get_hw_control sets CTRL_EXT:DRV_LOAD bit. For ASF and Pass Through versions of f/w this means that the driver is loaded.

igb_main.c 파일의 1564 번째 라인에서 정의되었습니다.

1565 {
1566  struct e1000_hw *hw = &adapter->hw;
1567  u32 ctrl_ext;
1568 
1569  /* Let firmware know the driver has taken over */
1570  ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
1572  ctrl_ext | E1000_CTRL_EXT_DRV_LOAD);
1573 }
struct e1000_hw hw
Definition: igb.h:594
#define E1000_CTRL_EXT
Definition: e1000_regs.h:32
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_CTRL_EXT_DRV_LOAD
Definition: e1000_defines.h:83
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static struct net_device_stats * igb_get_stats ( struct net_device *  netdev)
static

igb_get_stats - Get System Network Statistics : network interface device structure

Returns the address of the device statistics structure. The statistics are updated here and also from the timer callback.

igb_main.c 파일의 5834 번째 라인에서 정의되었습니다.

5835 {
5836  struct igb_adapter *adapter = netdev_priv(netdev);
5837 
5838  if (!test_bit(__IGB_RESETTING, &adapter->state))
5839  igb_update_stats(adapter);
5840 
5841 #ifdef HAVE_NETDEV_STATS_IN_NETDEV
5842  /* only return the current stats */
5843  return &netdev->stats;
5844 #else
5845  /* only return the current stats */
5846  return &adapter->net_stats;
5847 #endif /* HAVE_NETDEV_STATS_IN_NETDEV */
5848 }
struct net_device * netdev
Definition: igb.h:535
void igb_update_stats(struct igb_adapter *adapter)
Definition: igb_main.c:5908
unsigned long state
Definition: igb.h:537

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static long igb_getspeed ( struct file *  file,
void __user *  arg 
)
static

igb_main.c 파일의 10330 번째 라인에서 정의되었습니다.

10331 {
10332  struct igb_private_data *igb_priv = file->private_data;
10333  struct igb_adapter *adapter;
10334  struct igb_link_cmd req;
10335  u32 link;
10336 
10337  if (igb_priv == NULL) {
10338  printk("cannot find private data!\n");
10339  return -ENOENT;
10340  }
10341 
10342  adapter = igb_priv->adapter;
10343  if (adapter == NULL) {
10344  printk("map to unbound device!\n");
10345  return -ENOENT;
10346  }
10347 
10348  link = igb_has_link(adapter);
10349  if (link) {
10350  req.up = link;
10351  req.speed = adapter->link_speed;
10352  req.duplex = adapter->link_duplex;
10353  } else {
10354  req.up = link;
10355  req.speed = 0;
10356  req.duplex = DUPLEX_FULL;
10357  }
10358 
10359  if (copy_to_user(arg, &req, sizeof(req))) {
10360  printk("copyout to user failed\n");
10361  return -EFAULT;
10362  }
10363  return 0;
10364 }
struct igb_adapter * adapter
Definition: igb.h:929
u16 link_duplex
Definition: igb.h:562
u16 link_speed
Definition: igb.h:561
u_int32_t u32
Definition: e1000_osdep.h:50
bool igb_has_link(struct igb_adapter *adapter)
Definition: igb_main.c:4720
#define NULL
Null pointer value.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

bool igb_has_link ( struct igb_adapter adapter)

igb_has_link - check shared code for link and determine up/down : pointer to driver private info

igb_main.c 파일의 4720 번째 라인에서 정의되었습니다.

4721 {
4722  struct e1000_hw *hw = &adapter->hw;
4723  bool link_active = FALSE;
4724 
4725  /* get_link_status is set on LSC (link status) interrupt or
4726  * rx sequence error interrupt. get_link_status will stay
4727  * false until the e1000_check_for_link establishes link
4728  * for copper adapters ONLY
4729  */
4730  switch (hw->phy.media_type) {
4732  if (!hw->mac.get_link_status)
4733  return true;
4736  link_active = !hw->mac.get_link_status;
4737  break;
4739  default:
4740  break;
4741  }
4742 
4743  if (((hw->mac.type == e1000_i210) ||
4744  (hw->mac.type == e1000_i211)) &&
4745  (hw->phy.id == I210_I_PHY_ID)) {
4746  if (!netif_carrier_ok(adapter->netdev)) {
4747  adapter->flags &= ~IGB_FLAG_NEED_LINK_UPDATE;
4748  } else if (!(adapter->flags & IGB_FLAG_NEED_LINK_UPDATE)) {
4749  adapter->flags |= IGB_FLAG_NEED_LINK_UPDATE;
4750  adapter->link_check_timeout = jiffies;
4751  }
4752  }
4753 
4754  return link_active;
4755 }
unsigned long link_check_timeout
Definition: igb.h:683
struct e1000_hw hw
Definition: igb.h:594
struct net_device * netdev
Definition: igb.h:535
struct e1000_phy_info phy
Definition: e1000_hw.h:764
unsigned int flags
Definition: igb.h:538
#define I210_I_PHY_ID
enum e1000_media_type media_type
Definition: e1000_hw.h:657
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
#define FALSE
Definition: maap_log.h:94
#define IGB_FLAG_NEED_LINK_UPDATE
Definition: igb.h:724
bool get_link_status
Definition: e1000_hw.h:633
s32 e1000_check_for_link(struct e1000_hw *hw)
Definition: e1000_api.c:380

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_init_avb ( struct e1000_hw hw)
static

igb_main.c 파일의 10160 번째 라인에서 정의되었습니다.

10161 {
10162  u32 tqavctrl;
10163  u32 tqavcc0, tqavcc1;
10164  u32 tqavhc0, tqavhc1;
10165  u32 txpbsize;
10166 
10167  /* reconfigure the tx packet buffer allocation */
10168  txpbsize = (8);
10169  txpbsize |= (8) << E1000_TXPBSIZE_TX1PB_SHIFT;
10170  txpbsize |= (4) << E1000_TXPBSIZE_TX2PB_SHIFT;
10171  txpbsize |= (4) << E1000_TXPBSIZE_TX3PB_SHIFT;
10172 
10173  E1000_WRITE_REG(hw, E1000_ITPBS, txpbsize);
10174 
10175  /* std sized frames in 64 byte units with VLAN tags applied */
10176  E1000_WRITE_REG(hw, E1000_DTXMXPKTSZ, 1536 / 64);
10177 
10178  /*
10179  * this function defaults the QAV shaper to OFF (TX_ARB=0)
10180  * user-mode library can reconfigure thresholds and enable
10181  * after the device has started.
10182  */
10183 
10184  tqavcc0 = E1000_TQAVCC_QUEUEMODE; /* no idle slope */
10185  tqavcc1 = E1000_TQAVCC_QUEUEMODE; /* no idle slope */
10186  tqavhc0 = 0xFFFFFFFF; /* unlimited credits */
10187  tqavhc1 = 0xFFFFFFFF; /* unlimited credits */
10188 
10189  E1000_WRITE_REG(hw, E1000_I210_TQAVCC(0), tqavcc0);
10190  E1000_WRITE_REG(hw, E1000_I210_TQAVCC(1), tqavcc1);
10191  E1000_WRITE_REG(hw, E1000_I210_TQAVHC(0), tqavhc0);
10192  E1000_WRITE_REG(hw, E1000_I210_TQAVHC(1), tqavhc1);
10193 
10194  tqavctrl = E1000_TQAVCTRL_TXMODE |
10199 
10200  /* default to a 10 usec prefetch delta from launch time - time for
10201  * a 1500 byte rx frame to be received over the PCIe Gen1 x1 link.
10202  */
10203  tqavctrl |= (10 << 5) << E1000_TQAVCTRL_FETCH_TM_SHIFT;
10204 
10205  E1000_WRITE_REG(hw, E1000_I210_TQAVCTRL, tqavctrl);
10206 
10207  return 0;
10208 }
#define E1000_TQAVCTRL_FETCH_TM_SHIFT
#define E1000_TXPBSIZE_TX3PB_SHIFT
#define E1000_TXPBSIZE_TX1PB_SHIFT
#define E1000_ITPBS
Definition: e1000_regs.h:244
#define E1000_TQAVCC_QUEUEMODE
#define E1000_TQAVCTRL_DATA_FETCH_ARB
#define E1000_I210_TQAVHC(_n)
Definition: e1000_regs.h:155
#define E1000_TQAVCTRL_TXMODE
#define E1000_DTXMXPKTSZ
Definition: e1000_regs.h:152
#define E1000_TQAVCTRL_DATA_TRAN_ARB
#define E1000_TQAVCTRL_DATA_TRAN_TIM
#define E1000_TXPBSIZE_TX2PB_SHIFT
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_I210_TQAVCTRL
Definition: e1000_regs.h:151
#define E1000_I210_TQAVCC(_n)
Definition: e1000_regs.h:162
#define E1000_TQAVCTRL_SP_WAIT_SR

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_init_dmac ( struct igb_adapter adapter,
u32  pba 
)
static

igb_main.c 파일의 9969 번째 라인에서 정의되었습니다.

9970 {
9971  struct e1000_hw *hw = &adapter->hw;
9972  u32 dmac_thr;
9973  u16 hwm;
9974  u32 status;
9975 
9976  if (hw->mac.type == e1000_i211)
9977  return;
9978 
9979  if (hw->mac.type > e1000_82580) {
9980  if (adapter->dmac != IGB_DMAC_DISABLE) {
9981  u32 reg;
9982 
9983  /* force threshold to 0. */
9985 
9986  /*
9987  * DMA Coalescing high water mark needs to be greater
9988  * than the Rx threshold. Set hwm to PBA - max frame
9989  * size in 16B units, capping it at PBA - 6KB.
9990  */
9991  hwm = 64 * pba - adapter->max_frame_size / 16;
9992  if (hwm < 64 * (pba - 6))
9993  hwm = 64 * (pba - 6);
9994  reg = E1000_READ_REG(hw, E1000_FCRTC);
9995  reg &= ~E1000_FCRTC_RTH_COAL_MASK;
9996  reg |= ((hwm << E1000_FCRTC_RTH_COAL_SHIFT)
9998  E1000_WRITE_REG(hw, E1000_FCRTC, reg);
9999 
10000  /*
10001  * Set the DMA Coalescing Rx threshold to PBA - 2 * max
10002  * frame size, capping it at PBA - 10KB.
10003  */
10004  dmac_thr = pba - adapter->max_frame_size / 512;
10005  if (dmac_thr < pba - 10)
10006  dmac_thr = pba - 10;
10007  reg = E1000_READ_REG(hw, E1000_DMACR);
10008  reg &= ~E1000_DMACR_DMACTHR_MASK;
10009  reg |= ((dmac_thr << E1000_DMACR_DMACTHR_SHIFT)
10011 
10012  /* transition to L0x or L1 if available..*/
10014 
10015  /* Check if status is 2.5Gb backplane connection
10016  * before configuration of watchdog timer, which is
10017  * in msec values in 12.8usec intervals
10018  * watchdog timer= msec values in 32usec intervals
10019  * for non 2.5Gb connection
10020  */
10021  if (hw->mac.type == e1000_i354) {
10022  status = E1000_READ_REG(hw, E1000_STATUS);
10023  if ((status & E1000_STATUS_2P5_SKU) &&
10024  (!(status & E1000_STATUS_2P5_SKU_OVER)))
10025  reg |= ((adapter->dmac * 5) >> 6);
10026  else
10027  reg |= ((adapter->dmac) >> 5);
10028  } else {
10029  reg |= ((adapter->dmac) >> 5);
10030  }
10031 
10032  /*
10033  * Disable BMC-to-OS Watchdog enable
10034  * on devices that support OS-to-BMC
10035  */
10036  if (hw->mac.type != e1000_i354)
10037  reg &= ~E1000_DMACR_DC_BMC2OSW_EN;
10038  E1000_WRITE_REG(hw, E1000_DMACR, reg);
10039 
10040  /* no lower threshold to disable coalescing
10041  * (smart fifb)-UTRESH=0
10042  */
10044 
10045  /* This sets the time to wait before requesting
10046  * transition to low power state to number of usecs
10047  * needed to receive 1 512 byte frame at gigabit
10048  * line rate. On i350 device, time to make transition
10049  * to Lx state is delayed by 4 usec with flush disable
10050  * bit set to avoid losing mailbox interrupts
10051  */
10052  reg = E1000_READ_REG(hw, E1000_DMCTLX);
10053  if (hw->mac.type == e1000_i350)
10054  reg |= IGB_DMCTLX_DCFLUSH_DIS;
10055 
10056  /* in 2.5Gb connection, TTLX unit is 0.4 usec
10057  * which is 0x4*2 = 0xA. But delay is still 4 usec
10058  */
10059  if (hw->mac.type == e1000_i354) {
10060  status = E1000_READ_REG(hw, E1000_STATUS);
10061  if ((status & E1000_STATUS_2P5_SKU) &&
10062  (!(status & E1000_STATUS_2P5_SKU_OVER)))
10063  reg |= 0xA;
10064  else
10065  reg |= 0x4;
10066  } else {
10067  reg |= 0x4;
10068  }
10069 
10070  E1000_WRITE_REG(hw, E1000_DMCTLX, reg);
10071 
10072  /* free space in tx pkt buffer to wake from DMA coal */
10074  (IGB_TX_BUF_4096 + adapter->max_frame_size))
10075  >> 6);
10076 
10077  /* low power state decision controlled by DMA coal */
10078  reg = E1000_READ_REG(hw, E1000_PCIEMISC);
10080  E1000_WRITE_REG(hw, E1000_PCIEMISC, reg);
10081  } /* endif adapter->dmac is not disabled */
10082  } else if (hw->mac.type == e1000_82580) {
10083  u32 reg = E1000_READ_REG(hw, E1000_PCIEMISC);
10084 
10087  E1000_WRITE_REG(hw, E1000_DMACR, 0);
10088  }
10089 }
#define E1000_DMACR
Definition: e1000_regs.h:599
#define E1000_DMCRTRH
Definition: e1000_regs.h:602
#define E1000_STATUS_2P5_SKU_OVER
#define E1000_DMACR_DMACTHR_MASK
struct e1000_hw hw
Definition: igb.h:594
#define E1000_FCRTC
Definition: e1000_regs.h:604
#define E1000_DMCTLX
Definition: e1000_regs.h:601
#define E1000_DMACR_DMAC_EN
#define E1000_FCRTC_RTH_COAL_MASK
u32 max_frame_size
Definition: igb.h:579
#define E1000_DMACR_DC_BMC2OSW_EN
#define E1000_FCRTC_RTH_COAL_SHIFT
#define E1000_STATUS_2P5_SKU
#define E1000_DMACR_DMAC_LX_MASK
#define E1000_PCIEMISC
Definition: e1000_regs.h:605
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
u_int16_t u16
Definition: e1000_osdep.h:51
#define E1000_DMCTXTH
Definition: e1000_regs.h:600
int dmac
Definition: igb.h:635
#define E1000_DMACR_DMACTHR_SHIFT
#define E1000_STATUS
Definition: e1000_regs.h:29
#define IGB_DMCTLX_DCFLUSH_DIS
Definition: igb.h:738
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define IGB_DMAC_DISABLE
Definition: igb.h:741
#define IGB_TX_BUF_4096
Definition: igb.h:736
#define IGB_MIN_TXPBSIZE
Definition: igb.h:735
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_PCIEMISC_LX_DECISION
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_init_fw ( struct igb_adapter adapter)
static

igb_main.c 파일의 9929 번째 라인에서 정의되었습니다.

9930 {
9931  struct e1000_fw_drv_info fw_cmd;
9932  struct e1000_hw *hw = &adapter->hw;
9933  int i;
9934  u16 mask;
9935 
9936  if (hw->mac.type == e1000_i210)
9937  mask = E1000_SWFW_EEP_SM;
9938  else
9939  mask = E1000_SWFW_PHY0_SM;
9940  /* i211 parts do not support this feature */
9941  if (hw->mac.type == e1000_i211)
9942  hw->mac.arc_subsystem_valid = false;
9943 
9944  if (!hw->mac.ops.acquire_swfw_sync(hw, mask)) {
9945  for (i = 0; i <= FW_MAX_RETRIES; i++) {
9947  fw_cmd.hdr.cmd = FW_CMD_DRV_INFO;
9948  fw_cmd.hdr.buf_len = FW_CMD_DRV_INFO_LEN;
9949  fw_cmd.hdr.cmd_or_resp.cmd_resv = FW_CMD_RESERVED;
9950  fw_cmd.port_num = hw->bus.func;
9951  fw_cmd.drv_version = FW_FAMILY_DRV_VER;
9952  fw_cmd.hdr.checksum = 0;
9953  fw_cmd.hdr.checksum =
9954  e1000_calculate_checksum((u8 *)&fw_cmd,
9955  (FW_HDR_LEN +
9956  fw_cmd.hdr.buf_len));
9957  e1000_host_interface_command(hw, (u8 *)&fw_cmd,
9958  sizeof(fw_cmd));
9959  if (fw_cmd.hdr.cmd_or_resp.ret_status
9960  == FW_STATUS_SUCCESS)
9961  break;
9962  }
9963  } else
9964  dev_warn(pci_dev_to_dev(adapter->pdev),
9965  "Unable to get semaphore, firmware init failed.\n");
9966  hw->mac.ops.release_swfw_sync(hw, mask);
9967 }
#define E1000_FWSTS
Definition: e1000_regs.h:472
void(* release_swfw_sync)(struct e1000_hw *, u16)
Definition: e1000_hw.h:527
s32 e1000_host_interface_command(struct e1000_hw *hw, u8 *buffer, u32 length)
Definition: e1000_manage.c:371
struct e1000_hw hw
Definition: igb.h:594
bool arc_subsystem_valid
Definition: e1000_hw.h:629
struct e1000_bus_info bus
Definition: e1000_hw.h:766
struct pci_dev * pdev
Definition: igb.h:582
#define FW_STATUS_SUCCESS
Definition: igb.h:767
u8 e1000_calculate_checksum(u8 *buffer, u32 length)
Definition: e1000_manage.c:35
#define FW_CMD_DRV_INFO_LEN
Definition: igb.h:762
#define E1000_FWSTS_FWRI
#define E1000_SWFW_PHY0_SM
struct e1000_mac_info mac
Definition: e1000_hw.h:762
s32(* acquire_swfw_sync)(struct e1000_hw *, u16)
Definition: e1000_hw.h:526
enum e1000_mac_type type
Definition: e1000_hw.h:602
u_int16_t u16
Definition: e1000_osdep.h:51
#define FW_CMD_DRV_INFO
Definition: igb.h:761
#define FW_CMD_RESERVED
Definition: igb.h:763
#define FW_MAX_RETRIES
Definition: igb.h:766
#define FW_HDR_LEN
Definition: igb.h:760
#define FW_FAMILY_DRV_VER
Definition: igb.h:768
u_int8_t u8
Definition: e1000_osdep.h:52
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
struct e1000_mac_operations ops
Definition: e1000_hw.h:598
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_SWFW_EEP_SM

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_init_interrupt_scheme ( struct igb_adapter adapter,
bool  msix 
)
static

igb_init_interrupt_scheme - initialize interrupts, allocate queues/vectors

This function initializes the interrupts and allocates all of the queues.

igb_main.c 파일의 1343 번째 라인에서 정의되었습니다.

1344 {
1345  struct pci_dev *pdev = adapter->pdev;
1346  int err;
1347 
1348  igb_set_interrupt_capability(adapter, msix);
1349 
1350  err = igb_alloc_q_vectors(adapter);
1351  if (err) {
1352  dev_err(pci_dev_to_dev(pdev), "Unable to allocate memory for vectors\n");
1353  goto err_alloc_q_vectors;
1354  }
1355 
1356  igb_cache_ring_register(adapter);
1357 
1358  return 0;
1359 
1360 err_alloc_q_vectors:
1362  return err;
1363 }
int err
static void igb_reset_interrupt_capability(struct igb_adapter *adapter)
Definition: igb_main.c:811
struct pci_dev * pdev
Definition: igb.h:582
static int igb_alloc_q_vectors(struct igb_adapter *adapter)
Definition: igb_main.c:1286
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
static void igb_cache_ring_register(struct igb_adapter *adapter)
Definition: igb_main.c:458
static void igb_set_interrupt_capability(struct igb_adapter *adapter, bool msix)
Definition: igb_main.c:1057

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_init_mas ( struct igb_adapter adapter)
static

igb_init_mas - init Media Autosense feature if enabled in the NVM

: adapter struct

igb_main.c 파일의 2557 번째 라인에서 정의되었습니다.

2558 {
2559  struct e1000_hw *hw = &adapter->hw;
2560  u16 eeprom_data;
2561 
2562  e1000_read_nvm(hw, NVM_COMPAT, 1, &eeprom_data);
2563  switch (hw->bus.func) {
2564  case E1000_FUNC_0:
2565  if (eeprom_data & IGB_MAS_ENABLE_0)
2566  adapter->flags |= IGB_FLAG_MAS_ENABLE;
2567  break;
2568  case E1000_FUNC_1:
2569  if (eeprom_data & IGB_MAS_ENABLE_1)
2570  adapter->flags |= IGB_FLAG_MAS_ENABLE;
2571  break;
2572  case E1000_FUNC_2:
2573  if (eeprom_data & IGB_MAS_ENABLE_2)
2574  adapter->flags |= IGB_FLAG_MAS_ENABLE;
2575  break;
2576  case E1000_FUNC_3:
2577  if (eeprom_data & IGB_MAS_ENABLE_3)
2578  adapter->flags |= IGB_FLAG_MAS_ENABLE;
2579  break;
2580  default:
2581  /* Shouldn't get here */
2582  dev_err(pci_dev_to_dev(adapter->pdev),
2583  "%s:AMS: Invalid port configuration, returning\n",
2584  adapter->netdev->name);
2585  break;
2586  }
2587 }
struct e1000_hw hw
Definition: igb.h:594
#define E1000_FUNC_1
Definition: e1000_hw.h:81
struct e1000_bus_info bus
Definition: e1000_hw.h:766
struct net_device * netdev
Definition: igb.h:535
#define IGB_MAS_ENABLE_0
Definition: igb.h:730
struct pci_dev * pdev
Definition: igb.h:582
unsigned int flags
Definition: igb.h:538
s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
Definition: e1000_api.c:1039
u_int16_t u16
Definition: e1000_osdep.h:51
#define IGB_MAS_ENABLE_2
Definition: igb.h:732
#define IGB_MAS_ENABLE_1
Definition: igb.h:731
#define E1000_FUNC_3
Definition: e1000_hw.h:83
#define IGB_FLAG_MAS_ENABLE
Definition: igb.h:727
#define E1000_FUNC_0
Definition: e1000_hw.h:80
#define NVM_COMPAT
#define E1000_FUNC_2
Definition: e1000_hw.h:82
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
#define IGB_MAS_ENABLE_3
Definition: igb.h:733

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int __init igb_init_module ( void  )
static

igb_init_module - Driver Registration Routine

igb_init_module is the first routine called when the driver is loaded. All it does is register with the PCI subsystem.

igb_main.c 파일의 391 번째 라인에서 정의되었습니다.

392 {
393  int ret;
394 
395  pr_info("%s - version %s\n",
397 
398  pr_info("%s\n", igb_copyright);
399 #ifdef IGB_HWMON
400 /* only use IGB_PROCFS if IGB_HWMON is not defined */
401 #else
402 #ifdef IGB_PROCFS
403  if (igb_procfs_topdir_init())
404  pr_info("Procfs failed to initialize topdir\n");
405 #endif /* IGB_PROCFS */
406 #endif /* IGB_HWMON */
407 
408 #ifdef IGB_DCA
409  dca_register_notify(&dca_notifier);
410 #endif
411  misc_register(&igb_miscdev);
412  ret = pci_register_driver(&igb_driver);
413 #ifdef USE_REBOOT_NOTIFIER
414  if (ret >= 0)
415  register_reboot_notifier(&igb_notifier_reboot);
416 #endif
417  return ret;
418 }
char igb_driver_version[]
Definition: igb_main.c:88
static const char igb_copyright[]
Definition: igb_main.c:91
static struct miscdevice igb_miscdev
Definition: igb_main.c:316
static const char igb_driver_string[]
Definition: igb_main.c:89
static struct pci_driver igb_driver
Definition: igb_main.c:322

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static irqreturn_t igb_intr ( int  irq,
void *  data 
)
static

igb_intr - Legacy Interrupt Handler : interrupt number : pointer to a network interface device structure

igb_main.c 파일의 7167 번째 라인에서 정의되었습니다.

7168 {
7169  struct igb_adapter *adapter = data;
7170  struct igb_q_vector *q_vector = adapter->q_vector[0];
7171  struct e1000_hw *hw = &adapter->hw;
7172  /* Interrupt Auto-Mask...upon reading ICR, interrupts are masked. No
7173  * need for the IMC write
7174  */
7175  u32 icr = E1000_READ_REG(hw, E1000_ICR);
7176 
7177  /* IMS will not auto-mask if INT_ASSERTED is not set, and if it is
7178  * not set, then the adapter didn't send an interrupt
7179  */
7180  if (!(icr & E1000_ICR_INT_ASSERTED))
7181  return IRQ_NONE;
7182 
7183  igb_write_itr(q_vector);
7184 
7185  if (icr & E1000_ICR_DRSTA)
7186  schedule_work(&adapter->reset_task);
7187 
7188  if (icr & E1000_ICR_DOUTSYNC) {
7189  /* HW is reporting DMA is out of sync */
7190  adapter->stats.doosync++;
7191  }
7192 
7193  if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
7194  hw->mac.get_link_status = 1;
7195  /* guard against interrupt when we're going down */
7196  if (!test_bit(__IGB_DOWN, &adapter->state))
7197  mod_timer(&adapter->watchdog_timer, jiffies + 1);
7198  }
7199 
7200 #ifdef HAVE_PTP_1588_CLOCK
7201  if (icr & E1000_ICR_TS)
7202  igb_tsync_interrupt(adapter);
7203 #endif /* HAVE_PTP_1588_CLOCK */
7204 
7205  napi_schedule(&q_vector->napi);
7206 
7207  return IRQ_HANDLED;
7208 }
#define E1000_ICR_RXSEQ
struct e1000_hw hw
Definition: igb.h:594
#define E1000_ICR
Definition: e1000_regs.h:55
struct work_struct reset_task
Definition: igb.h:569
#define E1000_ICR_LSC
#define E1000_ICR_DOUTSYNC
struct e1000_mac_info mac
Definition: e1000_hw.h:762
static void igb_write_itr(struct igb_q_vector *q_vector)
Definition: igb_main.c:6242
struct timer_list watchdog_timer
Definition: igb.h:554
static void igb_tsync_interrupt(struct igb_adapter *adapter)
Definition: igb_main.c:6122
#define E1000_ICR_TS
unsigned long state
Definition: igb.h:537
struct igb_q_vector * q_vector[MAX_Q_VECTORS]
Definition: igb.h:607
#define E1000_ICR_INT_ASSERTED
bool get_link_status
Definition: e1000_hw.h:633
#define E1000_ICR_DRSTA
struct e1000_hw_stats stats
Definition: igb.h:595
u_int32_t u32
Definition: e1000_osdep.h:50
struct napi_struct napi
Definition: igb.h:421
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static irqreturn_t igb_intr_msi ( int  irq,
void *  data 
)
static

igb_intr_msi - Interrupt Handler : interrupt number : pointer to a network interface device structure

igb_main.c 파일의 7128 번째 라인에서 정의되었습니다.

7129 {
7130  struct igb_adapter *adapter = data;
7131  struct igb_q_vector *q_vector = adapter->q_vector[0];
7132  struct e1000_hw *hw = &adapter->hw;
7133  /* read ICR disables interrupts using IAM */
7134  u32 icr = E1000_READ_REG(hw, E1000_ICR);
7135 
7136  igb_write_itr(q_vector);
7137 
7138  if (icr & E1000_ICR_DRSTA)
7139  schedule_work(&adapter->reset_task);
7140 
7141  if (icr & E1000_ICR_DOUTSYNC) {
7142  /* HW is reporting DMA is out of sync */
7143  adapter->stats.doosync++;
7144  }
7145 
7146  if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
7147  hw->mac.get_link_status = 1;
7148  if (!test_bit(__IGB_DOWN, &adapter->state))
7149  mod_timer(&adapter->watchdog_timer, jiffies + 1);
7150  }
7151 
7152 #ifdef HAVE_PTP_1588_CLOCK
7153  if (icr & E1000_ICR_TS)
7154  igb_tsync_interrupt(adapter);
7155 #endif /* HAVE_PTP_1588_CLOCK */
7156 
7157  napi_schedule(&q_vector->napi);
7158 
7159  return IRQ_HANDLED;
7160 }
#define E1000_ICR_RXSEQ
struct e1000_hw hw
Definition: igb.h:594
#define E1000_ICR
Definition: e1000_regs.h:55
struct work_struct reset_task
Definition: igb.h:569
#define E1000_ICR_LSC
#define E1000_ICR_DOUTSYNC
struct e1000_mac_info mac
Definition: e1000_hw.h:762
static void igb_write_itr(struct igb_q_vector *q_vector)
Definition: igb_main.c:6242
struct timer_list watchdog_timer
Definition: igb.h:554
static void igb_tsync_interrupt(struct igb_adapter *adapter)
Definition: igb_main.c:6122
#define E1000_ICR_TS
unsigned long state
Definition: igb.h:537
struct igb_q_vector * q_vector[MAX_Q_VECTORS]
Definition: igb.h:607
bool get_link_status
Definition: e1000_hw.h:633
#define E1000_ICR_DRSTA
struct e1000_hw_stats stats
Definition: igb.h:595
u_int32_t u32
Definition: e1000_osdep.h:50
struct napi_struct napi
Definition: igb.h:421
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static pci_ers_result_t igb_io_error_detected ( struct pci_dev *  pdev,
pci_channel_state_t  state 
)
static

igb_io_error_detected - called when PCI error is detected : Pointer to PCI device : The current pci connection state

This function is called after a PCI bus error affecting this device has been detected.

igb_main.c 파일의 9513 번째 라인에서 정의되었습니다.

9515 {
9516  struct net_device *netdev = pci_get_drvdata(pdev);
9517  struct igb_adapter *adapter = netdev_priv(netdev);
9518 
9519 #ifdef CONFIG_PCI_IOV
9520  struct pci_dev *bdev, *vfdev;
9521  u32 dw0, dw1, dw2, dw3;
9522  int vf, pos;
9523  u16 req_id, pf_func;
9524 
9525  if (!(adapter->flags & IGB_FLAG_DETECT_BAD_DMA))
9526  goto skip_bad_vf_detection;
9527 
9528  bdev = pdev->bus->self;
9529  while (bdev && (pci_pcie_type(bdev) != PCI_EXP_TYPE_ROOT_PORT))
9530  bdev = bdev->bus->self;
9531 
9532  if (!bdev)
9533  goto skip_bad_vf_detection;
9534 
9535  pos = pci_find_ext_capability(bdev, PCI_EXT_CAP_ID_ERR);
9536  if (!pos)
9537  goto skip_bad_vf_detection;
9538 
9539  pci_read_config_dword(bdev, pos + PCI_ERR_HEADER_LOG, &dw0);
9540  pci_read_config_dword(bdev, pos + PCI_ERR_HEADER_LOG + 4, &dw1);
9541  pci_read_config_dword(bdev, pos + PCI_ERR_HEADER_LOG + 8, &dw2);
9542  pci_read_config_dword(bdev, pos + PCI_ERR_HEADER_LOG + 12, &dw3);
9543 
9544  req_id = dw1 >> 16;
9545  /* On the 82576 if bit 7 of the requestor ID is set then it's a VF */
9546  if (!(req_id & 0x0080))
9547  goto skip_bad_vf_detection;
9548 
9549  pf_func = req_id & 0x01;
9550  if ((pf_func & 1) == (pdev->devfn & 1)) {
9551 
9552  vf = (req_id & 0x7F) >> 1;
9553  dev_err(pci_dev_to_dev(pdev),
9554  "VF %d has caused a PCIe error\n", vf);
9555  dev_err(pci_dev_to_dev(pdev),
9556  "TLP: dw0: %8.8x\tdw1: %8.8x\tdw2:\n%8.8x\tdw3: %8.8x\n",
9557  dw0, dw1, dw2, dw3);
9558 
9559  /* Find the pci device of the offending VF */
9560  vfdev = pci_get_device(PCI_VENDOR_ID_INTEL,
9562  while (vfdev) {
9563  if (vfdev->devfn == (req_id & 0xFF))
9564  break;
9565  vfdev = pci_get_device(PCI_VENDOR_ID_INTEL,
9566  E1000_DEV_ID_82576_VF, vfdev);
9567  }
9568  /*
9569  * There's a slim chance the VF could have been hot plugged,
9570  * so if it is no longer present we don't need to issue the
9571  * VFLR. Just clean up the AER in that case.
9572  */
9573  if (vfdev) {
9574  dev_err(pci_dev_to_dev(pdev),
9575  "Issuing VFLR to VF %d\n", vf);
9576  pci_write_config_dword(vfdev, 0xA8, 0x00008000);
9577  }
9578 
9579  pci_cleanup_aer_uncorrect_error_status(pdev);
9580  }
9581 
9582  /*
9583  * Even though the error may have occurred on the other port
9584  * we still need to increment the vf error reference count for
9585  * both ports because the I/O resume function will be called
9586  * for both of them.
9587  */
9588  adapter->vferr_refcount++;
9589 
9590  return PCI_ERS_RESULT_RECOVERED;
9591 
9592 skip_bad_vf_detection:
9593 #endif /* CONFIG_PCI_IOV */
9594 
9595  netif_device_detach(netdev);
9596 
9597  if (state == pci_channel_io_perm_failure)
9598  return PCI_ERS_RESULT_DISCONNECT;
9599 
9600  if (netif_running(netdev))
9601  igb_down(adapter);
9602  pci_disable_device(pdev);
9603 
9604  /* Request a slot slot reset. */
9605  return PCI_ERS_RESULT_NEED_RESET;
9606 }
int vferr_refcount
Definition: igb.h:634
void igb_down(struct igb_adapter *adapter)
Definition: igb_main.c:1875
unsigned int flags
Definition: igb.h:538
#define E1000_DEV_ID_82576_VF
Definition: igb_main.c:9504
u_int16_t u16
Definition: e1000_osdep.h:51
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
u_int32_t u32
Definition: e1000_osdep.h:50
#define IGB_FLAG_DETECT_BAD_DMA
Definition: igb.h:719
#define NULL
Null pointer value.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static void igb_io_resume ( struct pci_dev *  pdev)
static

igb_io_resume - called when traffic can start flowing again. : Pointer to PCI device

This callback is called when the error recovery driver tells us that its OK to resume normal operation. Implementation resembles the second-half of the igb_resume routine.

igb_main.c 파일의 9652 번째 라인에서 정의되었습니다.

9653 {
9654  struct net_device *netdev = pci_get_drvdata(pdev);
9655  struct igb_adapter *adapter = netdev_priv(netdev);
9656 
9657  if (adapter->vferr_refcount) {
9658  dev_info(pci_dev_to_dev(pdev), "Resuming after VF err\n");
9659  adapter->vferr_refcount--;
9660  return;
9661  }
9662 
9663  if (netif_running(netdev)) {
9664  igb_up(adapter);
9665  }
9666 
9667  netif_device_attach(netdev);
9668 
9669  /* let the f/w know that the h/w is now under the control of the driver.
9670  */
9671  igb_get_hw_control(adapter);
9672 }
static void igb_get_hw_control(struct igb_adapter *adapter)
Definition: igb_main.c:1564
int vferr_refcount
Definition: igb.h:634
struct pci_dev * pdev
Definition: igb.h:582
void igb_up(struct igb_adapter *adapter)
Definition: igb_main.c:1829
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static pci_ers_result_t igb_io_slot_reset ( struct pci_dev *  pdev)
static

igb_io_slot_reset - called after the pci bus has been reset. : Pointer to PCI device

Restart the card from scratch, as if from a cold-boot. Implementation resembles the first-half of the igb_resume routine.

igb_main.c 파일의 9615 번째 라인에서 정의되었습니다.

9616 {
9617  struct net_device *netdev = pci_get_drvdata(pdev);
9618  struct igb_adapter *adapter = netdev_priv(netdev);
9619  struct e1000_hw *hw = &adapter->hw;
9620  pci_ers_result_t result;
9621 
9622  if (pci_enable_device_mem(pdev)) {
9623  dev_err(pci_dev_to_dev(pdev),
9624  "Cannot re-enable PCI device after reset.\n");
9625  result = PCI_ERS_RESULT_DISCONNECT;
9626  } else {
9627  pci_set_master(pdev);
9628  pci_restore_state(pdev);
9629  pci_save_state(pdev);
9630 
9631  pci_enable_wake(pdev, PCI_D3hot, 0);
9632  pci_enable_wake(pdev, PCI_D3cold, 0);
9633 
9634  schedule_work(&adapter->reset_task);
9635  E1000_WRITE_REG(hw, E1000_WUS, ~0);
9636  result = PCI_ERS_RESULT_RECOVERED;
9637  }
9638 
9639  pci_cleanup_aer_uncorrect_error_status(pdev);
9640 
9641  return result;
9642 }
struct e1000_hw hw
Definition: igb.h:594
struct work_struct reset_task
Definition: igb.h:569
#define E1000_WUS
Definition: e1000_regs.h:432
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static int igb_ioctl ( struct net_device *  netdev,
struct ifreq *  ifr,
int  cmd 
)
static

igb_ioctl - : : :

igb_main.c 파일의 8891 번째 라인에서 정의되었습니다.

8892 {
8893  switch (cmd) {
8894 #ifdef SIOCGMIIPHY
8895  case SIOCGMIIPHY:
8896  case SIOCGMIIREG:
8897  case SIOCSMIIREG:
8898  return igb_mii_ioctl(netdev, ifr, cmd);
8899 #endif
8900 #ifdef HAVE_PTP_1588_CLOCK
8901 #ifdef SIOCGHWTSTAMP
8902  case SIOCGHWTSTAMP:
8903  return igb_ptp_get_ts_config(netdev, ifr);
8904 #endif
8905  case SIOCSHWTSTAMP:
8906  return igb_ptp_set_ts_config(netdev, ifr);
8907 #endif /* HAVE_PTP_1588_CLOCK */
8908 #ifdef ETHTOOL_OPS_COMPAT
8909  case SIOCETHTOOL:
8910  return ethtool_ioctl(ifr);
8911 #endif
8912  default:
8913  return -EOPNOTSUPP;
8914  }
8915 }
int igb_ptp_get_ts_config(struct net_device *netdev, struct ifreq *ifr)
int igb_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr)
int ethtool_ioctl(struct ifreq *ifr)

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static long igb_ioctl_file ( struct file *  file,
unsigned int  cmd,
unsigned long  arg 
)
static

igb_main.c 파일의 10715 번째 라인에서 정의되었습니다.

10717 {
10718  void __user *argp = (void __user *) arg;
10719  int err;
10720 
10721  switch (cmd) {
10722  case IGB_BIND:
10723  err = igb_bind(file, argp);
10724  break;
10725  case IGB_UNBIND:
10726  err = igb_unbind(file);
10727  break;
10728  case IGB_MAP_TX_RING:
10729  case IGB_MAP_RX_RING:
10730  case IGB_IOCTL_MAP_TX_RING:
10731  case IGB_IOCTL_MAP_RX_RING:
10732  err = igb_mapbuf(file, argp, cmd);
10733  break;
10734  case IGB_MAPBUF:
10735  case IGB_IOCTL_MAPBUF:
10736  err = igb_mapbuf_user(file, argp, cmd);
10737  break;
10738  case IGB_UNMAP_TX_RING:
10739  case IGB_UNMAP_RX_RING:
10740  case IGB_UNMAPBUF:
10741  case IGB_IOCTL_UNMAPBUF:
10744  err = igb_unmapbuf(file, argp, cmd);
10745  break;
10746  case IGB_LINKSPEED:
10747  err = igb_getspeed(file, argp);
10748  break;
10749  default:
10750  err = -EINVAL;
10751  break;
10752  };
10753 
10754  return err;
10755 }
static long igb_mapbuf_user(struct file *file, void __user *arg, int ring)
Definition: igb_main.c:10366
#define IGB_IOCTL_MAPBUF
Definition: igb.h:894
int err
#define IGB_UNBIND
Definition: igb.h:875
static long igb_mapbuf(struct file *file, void __user *arg, int ring)
Definition: igb_main.c:10485
static long igb_getspeed(struct file *file, void __user *arg)
Definition: igb_main.c:10330
#define IGB_MAPBUF
Definition: igb.h:880
#define IGB_UNMAPBUF
Definition: igb.h:881
static int igb_unbind(struct file *file)
Definition: igb_main.c:10312
#define IGB_LINKSPEED
Definition: igb.h:882
#define IGB_IOCTL_MAP_RX_RING
Definition: igb.h:896
#define IGB_BIND
Definition: igb.h:874
#define IGB_IOCTL_UNMAP_TX_RING
Definition: igb.h:893
#define IGB_UNMAP_TX_RING
Definition: igb.h:879
static long igb_unmapbuf(struct file *file, void __user *arg, int ring)
Definition: igb_main.c:10603
#define IGB_MAP_TX_RING
Definition: igb.h:877
#define IGB_IOCTL_UNMAP_RX_RING
Definition: igb.h:897
static int igb_bind(struct file *file, void __user *argp)
Definition: igb_main.c:10264
static struct argp argp
Definition: aaf-listener.c:125
#define IGB_IOCTL_UNMAPBUF
Definition: igb.h:895
#define IGB_IOCTL_MAP_TX_RING
Definition: igb.h:891
#define IGB_MAP_RX_RING
Definition: igb.h:883
#define IGB_UNMAP_RX_RING
Definition: igb.h:884

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static void igb_irq_disable ( struct igb_adapter adapter)
static

igb_irq_disable - Mask off interrupt generation on the NIC : board private structure

igb_main.c 파일의 1438 번째 라인에서 정의되었습니다.

1439 {
1440  struct e1000_hw *hw = &adapter->hw;
1441 
1442  /*
1443  * we need to be careful when disabling interrupts. The VFs are also
1444  * mapped into these registers and so clearing the bits can cause
1445  * issues on the VF drivers so we only need to clear what we set
1446  */
1447  if (adapter->msix_entries) {
1448  u32 regval = E1000_READ_REG(hw, E1000_EIAM);
1449 
1450  E1000_WRITE_REG(hw, E1000_EIAM, regval
1451  & ~adapter->eims_enable_mask);
1453  regval = E1000_READ_REG(hw, E1000_EIAC);
1454  E1000_WRITE_REG(hw, E1000_EIAC, regval
1455  & ~adapter->eims_enable_mask);
1456  }
1457 
1458  E1000_WRITE_REG(hw, E1000_IAM, 0);
1459  E1000_WRITE_REG(hw, E1000_IMC, ~0);
1460  E1000_WRITE_FLUSH(hw);
1461 
1462  if (adapter->msix_entries) {
1463  int vector = 0, i;
1464 
1465  synchronize_irq(adapter->msix_entries[vector++].vector);
1466 
1467  for (i = 0; i < adapter->num_q_vectors; i++)
1468  synchronize_irq(adapter->msix_entries[vector++].vector);
1469  } else {
1470  synchronize_irq(adapter->pdev->irq);
1471  }
1472 }
unsigned int num_q_vectors
Definition: igb.h:540
struct msix_entry * msix_entries
Definition: igb.h:541
struct e1000_hw hw
Definition: igb.h:594
struct pci_dev * pdev
Definition: igb.h:582
#define E1000_EIAM
Definition: e1000_regs.h:71
#define E1000_IMC
Definition: e1000_regs.h:59
#define E1000_EIAC
Definition: e1000_regs.h:70
#define E1000_WRITE_FLUSH(a)
Definition: e1000_osdep.h:127
#define E1000_EIMC
Definition: e1000_regs.h:69
#define E1000_IAM
Definition: e1000_regs.h:60
u32 eims_enable_mask
Definition: igb.h:608
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_irq_enable ( struct igb_adapter adapter)
static

igb_irq_enable - Enable default interrupt generation settings : board private structure

igb_main.c 파일의 1478 번째 라인에서 정의되었습니다.

1479 {
1480  struct e1000_hw *hw = &adapter->hw;
1481 
1482  if (adapter->msix_entries) {
1484  u32 regval = E1000_READ_REG(hw, E1000_EIAC);
1485 
1486  E1000_WRITE_REG(hw, E1000_EIAC, regval
1487  | adapter->eims_enable_mask);
1488  regval = E1000_READ_REG(hw, E1000_EIAM);
1489  E1000_WRITE_REG(hw, E1000_EIAM, regval
1490  | adapter->eims_enable_mask);
1492  if (adapter->vfs_allocated_count) {
1493  E1000_WRITE_REG(hw, E1000_MBVFIMR, 0xFF);
1494  ims |= E1000_IMS_VMMB;
1495  if (adapter->mdd)
1496  if ((adapter->hw.mac.type == e1000_i350) ||
1497  (adapter->hw.mac.type == e1000_i354))
1498  ims |= E1000_IMS_MDDET;
1499  }
1500  E1000_WRITE_REG(hw, E1000_IMS, ims);
1501  } else {
1503  E1000_IMS_DRSTA);
1505  E1000_IMS_DRSTA);
1506  }
1507 }
#define E1000_IMS_DRSTA
struct msix_entry * msix_entries
Definition: igb.h:541
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
#define E1000_IMS_LSC
bool mdd
Definition: igb.h:623
#define E1000_EIAM
Definition: e1000_regs.h:71
#define E1000_IMS_DOUTSYNC
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
#define E1000_IMS
Definition: e1000_regs.h:58
#define E1000_EIAC
Definition: e1000_regs.h:70
#define E1000_IAM
Definition: e1000_regs.h:60
u32 eims_enable_mask
Definition: igb.h:608
#define E1000_MBVFIMR
Definition: e1000_regs.h:488
#define E1000_IMS_VMMB
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_EIMS
Definition: e1000_regs.h:68
#define IMS_ENABLE_MASK
#define E1000_IMS_MDDET
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static bool igb_is_non_eop ( struct igb_ring rx_ring,
union e1000_adv_rx_desc rx_desc 
)
static

igb_is_non_eop - process handling of non-EOP buffers : Rx ring being processed : Rx descriptor for current buffer

This function updates next to clean. If the buffer is an EOP buffer this function exits returning false, otherwise it will place the sk_buff in the next buffer to be chained and return true indicating that this is in fact a non-EOP buffer.

igb_main.c 파일의 8264 번째 라인에서 정의되었습니다.

8266 {
8267  u32 ntc = rx_ring->next_to_clean + 1;
8268 
8269  /* fetch, update, and store next to clean */
8270  ntc = (ntc < rx_ring->count) ? ntc : 0;
8271  rx_ring->next_to_clean = ntc;
8272 
8273  prefetch(IGB_RX_DESC(rx_ring, ntc));
8274 
8276  return false;
8277 
8278  return true;
8279 }
u16 count
Definition: igb.h:379
u16 next_to_clean
Definition: igb.h:384
#define prefetch(x)
Definition: e1000_osdep.h:65
#define likely(_x)
Definition: kcompat.h:255
#define E1000_RXD_STAT_EOP
#define IGB_RX_DESC(R, i)
Definition: igb.h:456
static __le32 igb_test_staterr(union e1000_adv_rx_desc *rx_desc, const u32 stat_err_bits)
Definition: igb.h:474
u_int32_t u32
Definition: e1000_osdep.h:50

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static struct igb_adapter* igb_lookup ( char *  id)
static

igb_main.c 파일의 10245 번째 라인에서 정의되었습니다.

10246 {
10247  struct igb_pci_lookup adapter_lookup;
10248  int ret_val;
10249 
10250  adapter_lookup.adapter = NULL;
10251  adapter_lookup.pci_info = id;
10252 
10253  /*
10254  * iterate over the loaded intefaces and match on their
10255  * pci device ID identifier - e.g. "0000:7:0.0"
10256  */
10257 
10258  ret_val = driver_for_each_device(&igb_driver.driver, NULL,
10259  &adapter_lookup, __igb_notify_lookup);
10260 
10261  return adapter_lookup.adapter;
10262 }
struct igb_adapter * adapter
Definition: igb.h:910
static int __igb_notify_lookup(struct device *dev, void *data)
Definition: igb_main.c:10229
#define NULL
Null pointer value.
static struct pci_driver igb_driver
Definition: igb_main.c:322

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_lro_flush ( struct igb_q_vector q_vector,
struct sk_buff *  skb 
)
static

igb_lro_flush - Indicate packets to upper layer.

Update IP and TCP header part of head skb if more than one skb's chained and indicate packets to upper layer.

igb_main.c 파일의 7854 번째 라인에서 정의되었습니다.

7856 {
7857  struct igb_lro_list *lrolist = &q_vector->lrolist;
7858 
7859  __skb_unlink(skb, &lrolist->active);
7860 
7861  if (IGB_CB(skb)->append_cnt) {
7862  struct igb_lrohdr *lroh = igb_lro_hdr(skb);
7863 
7864 #ifdef CONFIG_IGB_DISABLE_PACKET_SPLIT
7865  /* close any active lro contexts */
7866  igb_close_active_frag_list(skb);
7867 
7868 #endif
7869  /* incorporate ip header and re-calculate checksum */
7870  lroh->iph.tot_len = ntohs(skb->len);
7871  lroh->iph.check = 0;
7872 
7873  /* header length is 5 since we know no options exist */
7874  lroh->iph.check = ip_fast_csum((u8 *)lroh, 5);
7875 
7876  /* clear TCP checksum to indicate we are an LRO frame */
7877  lroh->th.check = 0;
7878 
7879  /* incorporate latest timestamp into the tcp header */
7880  if (IGB_CB(skb)->tsecr) {
7881  lroh->ts[2] = IGB_CB(skb)->tsecr;
7882  lroh->ts[1] = htonl(IGB_CB(skb)->tsval);
7883  }
7884 #ifdef NETIF_F_GSO
7885 
7886 #ifdef NAPI_GRO_CB
7887  NAPI_GRO_CB(skb)->data_offset = 0;
7888 #endif
7889  skb_shinfo(skb)->gso_size = IGB_CB(skb)->mss;
7890  skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4;
7891 #endif
7892  }
7893 
7894 #ifdef HAVE_VLAN_RX_REGISTER
7895  igb_receive_skb(q_vector, skb);
7896 #else
7897  napi_gro_receive(&q_vector->napi, skb);
7898 #endif
7899  lrolist->stats.flushed++;
7900 }
u32 flushed
Definition: igb.h:227
struct igb_lro_stats stats
Definition: igb.h:248
#define IGB_CB(skb)
Definition: igb.h:271
struct igb_lro_list lrolist
Definition: igb.h:423
struct iphdr iph
Definition: igb.h:241
#define napi_gro_receive(_napi, _skb)
Definition: kcompat.h:212
u_int8_t u8
Definition: e1000_osdep.h:52
struct sk_buff_head active
Definition: igb.h:247
struct tcphdr th
Definition: igb.h:242
__be32 ts[0]
Definition: igb.h:243
static struct igb_lrohdr * igb_lro_hdr(struct sk_buff *skb)
Definition: igb_main.c:7843
struct napi_struct napi
Definition: igb.h:421

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_lro_flush_all ( struct igb_q_vector q_vector)
static

igb_main.c 파일의 7902 번째 라인에서 정의되었습니다.

7903 {
7904  struct igb_lro_list *lrolist = &q_vector->lrolist;
7905  struct sk_buff *skb, *tmp;
7906 
7907  skb_queue_reverse_walk_safe(&lrolist->active, skb, tmp)
7908  igb_lro_flush(q_vector, skb);
7909 }
static void igb_lro_flush(struct igb_q_vector *q_vector, struct sk_buff *skb)
Definition: igb_main.c:7854
struct igb_lro_list lrolist
Definition: igb.h:423
struct sk_buff_head active
Definition: igb.h:247

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static struct igb_lrohdr* igb_lro_hdr ( struct sk_buff *  skb)
static

igb_main.c 파일의 7843 번째 라인에서 정의되었습니다.

7844 {
7845  return (struct igb_lrohdr *)skb->data;
7846 }

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_lro_header_ok ( struct sk_buff *  skb)
static

igb_main.c 파일의 7914 번째 라인에서 정의되었습니다.

7915 {
7916  struct igb_lrohdr *lroh = igb_lro_hdr(skb);
7917  u16 opt_bytes, data_len;
7918 
7919 #ifdef CONFIG_IGB_DISABLE_PACKET_SPLIT
7920  IGB_CB(skb)->tail = NULL;
7921 #endif
7922  IGB_CB(skb)->tsecr = 0;
7923  IGB_CB(skb)->append_cnt = 0;
7924  IGB_CB(skb)->mss = 0;
7925 
7926  /* ensure that the checksum is valid */
7927  if (skb->ip_summed != CHECKSUM_UNNECESSARY)
7928  return;
7929 
7930  /* If we see CE codepoint in IP header, packet is not mergeable */
7931  if (INET_ECN_is_ce(ipv4_get_dsfield(&lroh->iph)))
7932  return;
7933 
7934  /* ensure no bits set besides ack or psh */
7935  if (lroh->th.fin || lroh->th.syn || lroh->th.rst ||
7936  lroh->th.urg || lroh->th.ece || lroh->th.cwr ||
7937  !lroh->th.ack)
7938  return;
7939 
7940  /* store the total packet length */
7941  data_len = ntohs(lroh->iph.tot_len);
7942 
7943  /* remove any padding from the end of the skb */
7944  __pskb_trim(skb, data_len);
7945 
7946  /* remove header length from data length */
7947  data_len -= sizeof(struct igb_lrohdr);
7948 
7949  /*
7950  * check for timestamps. Since the only option we handle are timestamps,
7951  * we only have to handle the simple case of aligned timestamps
7952  */
7953  opt_bytes = (lroh->th.doff << 2) - sizeof(struct tcphdr);
7954  if (opt_bytes != 0) {
7955  if ((opt_bytes != TCPOLEN_TSTAMP_ALIGNED) ||
7956  !pskb_may_pull(skb, sizeof(struct igb_lrohdr) +
7957  TCPOLEN_TSTAMP_ALIGNED) ||
7958  (lroh->ts[0] != htonl((TCPOPT_NOP << 24) |
7959  (TCPOPT_NOP << 16) |
7960  (TCPOPT_TIMESTAMP << 8) |
7961  TCPOLEN_TIMESTAMP)) ||
7962  (lroh->ts[2] == 0)) {
7963  return;
7964  }
7965 
7966  IGB_CB(skb)->tsval = ntohl(lroh->ts[1]);
7967  IGB_CB(skb)->tsecr = lroh->ts[2];
7968 
7969  data_len -= TCPOLEN_TSTAMP_ALIGNED;
7970  }
7971 
7972  /* record data_len as mss for the packet */
7973  IGB_CB(skb)->mss = data_len;
7974  IGB_CB(skb)->next_seq = ntohl(lroh->th.seq);
7975 }
#define IGB_CB(skb)
Definition: igb.h:271
u_int16_t u16
Definition: e1000_osdep.h:51
struct iphdr iph
Definition: igb.h:241
struct tcphdr th
Definition: igb.h:242
__be32 ts[0]
Definition: igb.h:243
static struct igb_lrohdr * igb_lro_hdr(struct sk_buff *skb)
Definition: igb_main.c:7843
#define NULL
Null pointer value.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_lro_receive ( struct igb_q_vector q_vector,
struct sk_buff *  new_skb 
)
static

igb_lro_receive - if able, queue skb into lro chain : structure containing interrupt and ring information : pointer to current skb being checked

Checks whether the skb given is eligible for LRO and if that's fine chains it to the existing lro_skb based on flowid. If an LRO for the flow doesn't exist create one.

igb_main.c 파일의 8015 번째 라인에서 정의되었습니다.

8017 {
8018  struct sk_buff *lro_skb;
8019  struct igb_lro_list *lrolist = &q_vector->lrolist;
8020  struct igb_lrohdr *lroh = igb_lro_hdr(new_skb);
8021  __be32 saddr = lroh->iph.saddr;
8022  __be32 daddr = lroh->iph.daddr;
8023  __be32 tcp_ports = *(__be32 *)&lroh->th;
8024  u16 data_len;
8025 #ifdef HAVE_VLAN_RX_REGISTER
8026  u16 vid = IGB_CB(new_skb)->vid;
8027 #else
8028  u16 vid = new_skb->vlan_tci;
8029 #endif
8030 
8031  igb_lro_header_ok(new_skb);
8032 
8033  /*
8034  * we have a packet that might be eligible for LRO,
8035  * so see if it matches anything we might expect
8036  */
8037  skb_queue_walk(&lrolist->active, lro_skb) {
8038  if (*(__be32 *)&igb_lro_hdr(lro_skb)->th != tcp_ports ||
8039  igb_lro_hdr(lro_skb)->iph.saddr != saddr ||
8040  igb_lro_hdr(lro_skb)->iph.daddr != daddr)
8041  continue;
8042 
8043 #ifdef HAVE_VLAN_RX_REGISTER
8044  if (IGB_CB(lro_skb)->vid != vid)
8045 #else
8046  if (lro_skb->vlan_tci != vid)
8047 #endif
8048  continue;
8049 
8050  /* out of order packet */
8051  if (IGB_CB(lro_skb)->next_seq != IGB_CB(new_skb)->next_seq) {
8052  igb_lro_flush(q_vector, lro_skb);
8053  IGB_CB(new_skb)->mss = 0;
8054  break;
8055  }
8056 
8057  /* TCP timestamp options have changed */
8058  if (!IGB_CB(lro_skb)->tsecr != !IGB_CB(new_skb)->tsecr) {
8059  igb_lro_flush(q_vector, lro_skb);
8060  break;
8061  }
8062 
8063  /* make sure timestamp values are increasing */
8064  if (IGB_CB(lro_skb)->tsecr &&
8065  IGB_CB(lro_skb)->tsval > IGB_CB(new_skb)->tsval) {
8066  igb_lro_flush(q_vector, lro_skb);
8067  IGB_CB(new_skb)->mss = 0;
8068  break;
8069  }
8070 
8071  data_len = IGB_CB(new_skb)->mss;
8072 
8073  /* Check for all of the above below
8074  * malformed header
8075  * no tcp data
8076  * resultant packet would be too large
8077  * new skb is larger than our current mss
8078  * data would remain in header
8079  * we would consume more frags then the sk_buff contains
8080  * ack sequence numbers changed
8081  * window size has changed
8082  */
8083  if (data_len == 0 ||
8084  data_len > IGB_CB(lro_skb)->mss ||
8085  data_len > IGB_CB(lro_skb)->free ||
8086 #ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
8087  data_len != new_skb->data_len ||
8088  skb_shinfo(new_skb)->nr_frags >=
8089  (MAX_SKB_FRAGS - skb_shinfo(lro_skb)->nr_frags) ||
8090 #endif
8091  igb_lro_hdr(lro_skb)->th.ack_seq != lroh->th.ack_seq ||
8092  igb_lro_hdr(lro_skb)->th.window != lroh->th.window) {
8093  igb_lro_flush(q_vector, lro_skb);
8094  break;
8095  }
8096 
8097  /* Remove IP and TCP header*/
8098  skb_pull(new_skb, new_skb->len - data_len);
8099 
8100  /* update timestamp and timestamp echo response */
8101  IGB_CB(lro_skb)->tsval = IGB_CB(new_skb)->tsval;
8102  IGB_CB(lro_skb)->tsecr = IGB_CB(new_skb)->tsecr;
8103 
8104  /* update sequence and free space */
8105  IGB_CB(lro_skb)->next_seq += data_len;
8106  IGB_CB(lro_skb)->free -= data_len;
8107 
8108  /* update append_cnt */
8109  IGB_CB(lro_skb)->append_cnt++;
8110 
8111 #ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
8112  /* if header is empty pull pages into current skb */
8113  igb_merge_frags(lro_skb, new_skb);
8114 #else
8115  /* chain this new skb in frag_list */
8116  igb_add_active_tail(lro_skb, new_skb);
8117 #endif
8118 
8119  if ((data_len < IGB_CB(lro_skb)->mss) || lroh->th.psh ||
8120  skb_shinfo(lro_skb)->nr_frags == MAX_SKB_FRAGS) {
8121  igb_lro_hdr(lro_skb)->th.psh |= lroh->th.psh;
8122  igb_lro_flush(q_vector, lro_skb);
8123  }
8124 
8125  lrolist->stats.coal++;
8126  return;
8127  }
8128 
8129  if (IGB_CB(new_skb)->mss && !lroh->th.psh) {
8130  /* if we are at capacity flush the tail */
8131  if (skb_queue_len(&lrolist->active) >= IGB_LRO_MAX) {
8132  lro_skb = skb_peek_tail(&lrolist->active);
8133  if (lro_skb)
8134  igb_lro_flush(q_vector, lro_skb);
8135  }
8136 
8137  /* update sequence and free space */
8138  IGB_CB(new_skb)->next_seq += IGB_CB(new_skb)->mss;
8139  IGB_CB(new_skb)->free = 65521 - new_skb->len;
8140 
8141  /* .. and insert at the front of the active list */
8142  __skb_queue_head(&lrolist->active, new_skb);
8143 
8144  lrolist->stats.coal++;
8145  return;
8146  }
8147 
8148  /* packet not handled by any of the above, pass it to the stack */
8149 #ifdef HAVE_VLAN_RX_REGISTER
8150  igb_receive_skb(q_vector, new_skb);
8151 #else
8152  napi_gro_receive(&q_vector->napi, new_skb);
8153 #endif
8154 }
struct igb_lro_stats stats
Definition: igb.h:248
#define IGB_LRO_MAX
Definition: igb.h:225
#define IGB_CB(skb)
Definition: igb.h:271
u32 coal
Definition: igb.h:228
static void igb_lro_flush(struct igb_q_vector *q_vector, struct sk_buff *skb)
Definition: igb_main.c:7854
u_int16_t u16
Definition: e1000_osdep.h:51
struct igb_lro_list lrolist
Definition: igb.h:423
struct iphdr iph
Definition: igb.h:241
#define napi_gro_receive(_napi, _skb)
Definition: kcompat.h:212
static void igb_merge_frags(struct sk_buff *lro_skb, struct sk_buff *new_skb)
Definition: igb_main.c:7978
struct sk_buff_head active
Definition: igb.h:247
#define free(a)
struct tcphdr th
Definition: igb.h:242
static void igb_lro_header_ok(struct sk_buff *skb)
Definition: igb_main.c:7914
static struct igb_lrohdr * igb_lro_hdr(struct sk_buff *skb)
Definition: igb_main.c:7843
struct napi_struct napi
Definition: igb.h:421

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static long igb_mapbuf ( struct file *  file,
void __user *  arg,
int  ring 
)
static

igb_main.c 파일의 10485 번째 라인에서 정의되었습니다.

10486 {
10487  struct igb_private_data *igb_priv = file->private_data;
10488  struct igb_adapter *adapter;
10489  struct igb_buf_cmd req;
10490  /*size used for the purpose of copying the contents of igb_buf_cmd
10491  between userspace and kernel space
10492  introduced to handle possible mismatch in libigb and igb version*/
10493  int buf_cmd_size = 0;
10494 
10495  int err = 0;
10496 
10497  if (igb_priv == NULL) {
10498  printk("cannot find private data!\n");
10499  return -ENOENT;
10500  }
10501 
10502  adapter = igb_priv->adapter;
10503  if (adapter == NULL) {
10504  printk("map to unbound device!\n");
10505  return -ENOENT;
10506  }
10507 
10508  if((ring != IGB_IOCTL_MAP_TX_RING) && (ring != IGB_IOCTL_MAP_RX_RING))
10509  {
10510  dev_warn(&adapter->pdev->dev, "Old ioctl value used: %d, consider using new one from libigb \n", ring);
10511  /* this situation suggest using an old ioctl by libigb
10512  as a consequence the igb_buf_cmd struct from libigb perspective does not contain the "pa" field
10513  we need to align the requested size in copy_from_user() for possibility */
10514  buf_cmd_size = sizeof(req) - sizeof(u64);
10515 
10516  } else {
10517 
10518  /* assuming no compatibility issue:
10519  libigb and kernel module have the same
10520  igb_buf_cmd structs ("pa" field included in both)
10521  */
10522  buf_cmd_size = sizeof(req);
10523 
10524  }
10525 
10526  if (copy_from_user(&req, arg, buf_cmd_size))
10527  return -EFAULT;
10528 
10529  if ((ring == IGB_MAPRING) || (ring == IGB_MAP_TX_RING) ||
10530  ring == IGB_IOCTL_MAP_TX_RING) {
10531  if (req.queue >= 3) {
10532  printk("mapring:invalid queue specified(%d)\n",
10533  req.queue);
10534  return -EINVAL;
10535  }
10536 
10537  if(!adapter->num_tx_queues) {
10538  printk("igb_avb igb_mapbuf:tx ring freed %s\n", adapter->netdev->name);
10539  return -EINVAL;
10540  }
10541 
10542  mutex_lock(&adapter->lock);
10543  if (adapter->uring_tx_init & (1 << req.queue)) {
10544  mutex_unlock(&adapter->lock);
10545  printk("mapring:queue in use (%d)\n", req.queue);
10546  return -EBUSY;
10547  }
10548 
10549  adapter->uring_tx_init |= (1 << req.queue);
10550  igb_priv->uring_tx_init |= (1 << req.queue);
10551 
10552  if(ring == IGB_IOCTL_MAP_TX_RING)
10553  req.pa = virt_to_phys(adapter->tx_ring[req.queue]->desc);
10554 
10555  req.physaddr = adapter->tx_ring[req.queue]->dma;
10556  req.mmap_size = adapter->tx_ring[req.queue]->size;
10557  mutex_unlock(&adapter->lock);
10558  } else if ((ring == IGB_MAP_RX_RING) || (ring == IGB_IOCTL_MAP_RX_RING)) {
10559  if (req.queue >= 3) {
10560  printk("mapring:invalid queue specified(%d)\n",
10561  req.queue);
10562  return -EINVAL;
10563  }
10564 
10565  if(!adapter->num_rx_queues) {
10566  printk("igb_avb igb_mapbuf:rx ring freed %s \n", adapter->netdev->name);
10567  return -EINVAL;
10568  }
10569 
10570  mutex_lock(&adapter->lock);
10571  if (adapter->uring_rx_init & (1 << req.queue)) {
10572  mutex_unlock(&adapter->lock);
10573  printk("mapring:queue in use (%d)\n", req.queue);
10574  return -EBUSY;
10575  }
10576 
10577  adapter->uring_rx_init |= (1 << req.queue);
10578  igb_priv->uring_rx_init |= (1 << req.queue);
10579 
10580  if(ring == IGB_IOCTL_MAP_RX_RING)
10581  req.pa = virt_to_phys(adapter->rx_ring[req.queue]->desc);
10582 
10583  req.physaddr = adapter->rx_ring[req.queue]->dma;
10584  req.mmap_size = adapter->rx_ring[req.queue]->size;
10585  mutex_unlock(&adapter->lock);
10586  } else {
10587  printk("mapring: invalid ioctl %d\n", _IOC_NR(ring));
10588  return -EINVAL;
10589  }
10590 
10591  if (copy_to_user(arg, &req, buf_cmd_size)) {
10592  printk("copyout to user failed\n");
10593  err = -EFAULT;
10594  goto failed;
10595  }
10596 
10597  return 0;
10598 
10599 failed:
10600  return err;
10601 }
struct igb_adapter * adapter
Definition: igb.h:929
int err
struct mutex lock
Definition: igb.h:693
struct net_device * netdev
Definition: igb.h:535
struct pci_dev * pdev
Definition: igb.h:582
unsigned int size
Definition: igb.h:377
int num_tx_queues
Definition: igb.h:547
u32 uring_rx_init
Definition: igb.h:934
int num_rx_queues
Definition: igb.h:551
u32 uring_tx_init
Definition: igb.h:584
u32 uring_tx_init
Definition: igb.h:933
u32 uring_rx_init
Definition: igb.h:585
struct igb_ring * rx_ring[IGB_MAX_RX_QUEUES]
Definition: igb.h:552
void * desc
Definition: igb.h:373
struct igb_ring * tx_ring[IGB_MAX_TX_QUEUES]
Definition: igb.h:548
#define IGB_IOCTL_MAP_RX_RING
Definition: igb.h:896
#define IGB_MAPRING
Definition: igb.h:876
dma_addr_t dma
Definition: igb.h:376
#define IGB_MAP_TX_RING
Definition: igb.h:877
#define IGB_IOCTL_MAP_TX_RING
Definition: igb.h:891
u_int64_t u64
Definition: e1000_osdep.h:49
#define IGB_MAP_RX_RING
Definition: igb.h:883
#define NULL
Null pointer value.

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static long igb_mapbuf_user ( struct file *  file,
void __user *  arg,
int  ring 
)
static

igb_main.c 파일의 10366 번째 라인에서 정의되었습니다.

10367 {
10368  struct igb_private_data *igb_priv = file->private_data;
10369  struct igb_adapter *adapter;
10370  struct igb_buf_cmd req;
10371  /*size used for the purpose of copying the contents of igb_buf_cmd
10372  between userspace and kernel space
10373  introduced to handle possible mismatch in libigb and igb version*/
10374  int buf_cmd_size = 0;
10375  int err = 0;
10376  struct page *page;
10377  dma_addr_t page_dma;
10378  struct igb_user_page *userpage;
10379 
10380 
10381  if (igb_priv == NULL) {
10382  printk("cannot find private data!\n");
10383  return -ENOENT;
10384  }
10385 
10386  adapter = igb_priv->adapter;
10387  if (adapter == NULL) {
10388  printk("map to unbound device!\n");
10389  return -ENOENT;
10390  }
10391 
10392  if(ring != IGB_IOCTL_MAPBUF)
10393  {
10394  dev_warn(&adapter->pdev->dev, "Old ioctl value used: %d, consider using a new one from libigb \n", ring);
10395  /* this situation suggest using an old ioctl by libigb
10396  as a consequence the igb_buf_cmd struct from libigb perspective does not contain the "pa" field
10397  we need to align the requested size in copy_from_user() for possibility */
10398  buf_cmd_size = sizeof(req) - sizeof(u64);
10399  } else {
10400  /* assuming no compatibility issue:
10401  libigb and kernel module have the same
10402  igb_buf_cmd structs ("pa" field included in both)
10403  */
10404  buf_cmd_size = sizeof(req);
10405  }
10406 
10407  if (copy_from_user(&req, arg, buf_cmd_size))
10408  return -EFAULT;
10409 
10410  userpage = vzalloc(sizeof(struct igb_user_page));
10411  if (unlikely(!userpage)) {
10412  err = -ENOMEM;
10413  goto failed;
10414  }
10415 
10416  mutex_lock(&adapter->lock);
10417  if (igb_priv->userpages == NULL) {
10418  igb_priv->userpages = userpage;
10419  } else {
10420  userpage->next = igb_priv->userpages;
10421  igb_priv->userpages->prev = userpage;
10422  igb_priv->userpages = userpage;
10423  }
10424 
10425 #if defined(CONFIG_IGB_SUPPORT_32BIT_IOCTL)
10426 #if defined(CONFIG_ZONE_DMA32)
10427  page = alloc_page(GFP_ATOMIC | __GFP_COLD | GFP_DMA32);
10428 #else /* defined(CONFIG_ZONE_DMA32) */
10429  page = alloc_page(GFP_ATOMIC | __GFP_COLD | GFP_DMA);
10430 #endif /* defined(CONFIG_ZONE_DMA32) */
10431 #else /* defined(CONFIG_IGB_SUPPORT_32BIT_IOCTL) */
10432  page = alloc_page(GFP_ATOMIC | __GFP_COLD);
10433 #endif /* defined(CONFIG_IGB_SUPPORT_32BIT_IOCTL) */
10434  if (unlikely(!page)) {
10435  err = -ENOMEM;
10436  goto page_failed;
10437  }
10438 
10439  page_dma = dma_map_page(pci_dev_to_dev(adapter->pdev), page,
10440  0, PAGE_SIZE, DMA_FROM_DEVICE);
10441 
10442  if (dma_mapping_error(pci_dev_to_dev(adapter->pdev), page_dma)) {
10443  err = -ENOMEM;
10444  goto map_failed;
10445  }
10446 
10447  igb_priv->userpages->page = page;
10448  igb_priv->userpages->page_dma = page_dma;
10449 
10450  if(ring == IGB_IOCTL_MAPBUF)
10451  req.pa = page_to_phys(page);
10452 
10453  req.physaddr = page_dma;
10454  req.mmap_size = PAGE_SIZE;
10455  mutex_unlock(&adapter->lock);
10456 
10457  if (copy_to_user(arg, &req, buf_cmd_size)) {
10458  printk("copyout to user failed\n");
10459  err = -EFAULT;
10460  mutex_lock(&adapter->lock);
10461  goto copy_failed;
10462  }
10463 
10464  return 0;
10465 
10466 copy_failed:
10467  dma_unmap_page(pci_dev_to_dev(adapter->pdev),
10468  userpage->page_dma, PAGE_SIZE,
10469  DMA_FROM_DEVICE);
10470 map_failed:
10471  put_page(userpage->page);
10472 page_failed:
10473  if (userpage->prev)
10474  userpage->prev->next = userpage->next;
10475  if (userpage->next)
10476  userpage->next->prev = userpage->prev;
10477  if (userpage == igb_priv->userpages)
10478  igb_priv->userpages = userpage->next;
10479  vfree(userpage);
10480  mutex_unlock(&adapter->lock);
10481 failed:
10482  return err;
10483 }
#define IGB_IOCTL_MAPBUF
Definition: igb.h:894
struct igb_adapter * adapter
Definition: igb.h:929
int err
struct mutex lock
Definition: igb.h:693
dma_addr_t page_dma
Definition: igb.h:52
struct pci_dev * pdev
Definition: igb.h:582
static struct igb_packet * alloc_page(device_t *dev, struct igb_dma_alloc *a_page)
Definition: openavb_igb.c:66
struct page * page
Definition: igb.h:51
struct igb_user_page * next
Definition: igb.h:50
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
#define __GFP_COLD
Definition: kcompat.h:359
struct igb_user_page * userpages
Definition: igb.h:931
#define unlikely(_x)
Definition: kcompat.h:254
struct igb_user_page * prev
Definition: igb.h:49
u_int64_t u64
Definition: e1000_osdep.h:49
#define NULL
Null pointer value.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_maybe_stop_tx ( struct igb_ring tx_ring,
const u16  size 
)
inlinestatic

igb_main.c 파일의 5643 번째 라인에서 정의되었습니다.

5644 {
5645  if (igb_desc_unused(tx_ring) >= size)
5646  return 0;
5647  return __igb_maybe_stop_tx(tx_ring, size);
5648 }
static u16 igb_desc_unused(const struct igb_ring *ring)
Definition: igb.h:481
int size
static int __igb_maybe_stop_tx(struct igb_ring *tx_ring, const u16 size)
Definition: igb_main.c:5611

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_merge_frags ( struct sk_buff *  lro_skb,
struct sk_buff *  new_skb 
)
static

igb_main.c 파일의 7978 번째 라인에서 정의되었습니다.

7979 {
7980  struct skb_shared_info *sh_info;
7981  struct skb_shared_info *new_skb_info;
7982  unsigned int data_len;
7983 
7984  sh_info = skb_shinfo(lro_skb);
7985  new_skb_info = skb_shinfo(new_skb);
7986 
7987  /* copy frags into the last skb */
7988  memcpy(sh_info->frags + sh_info->nr_frags,
7989  new_skb_info->frags,
7990  new_skb_info->nr_frags * sizeof(skb_frag_t));
7991 
7992  /* copy size data over */
7993  sh_info->nr_frags += new_skb_info->nr_frags;
7994  data_len = IGB_CB(new_skb)->mss;
7995  lro_skb->len += data_len;
7996  lro_skb->data_len += data_len;
7997  lro_skb->truesize += data_len;
7998 
7999  /* wipe record of data from new_skb */
8000  new_skb_info->nr_frags = 0;
8001  new_skb->len = new_skb->data_len = 0;
8002  dev_kfree_skb_any(new_skb);
8003 }
#define IGB_CB(skb)
Definition: igb.h:271

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_mmap ( struct file *  file,
struct vm_area_struct *  vma 
)
static

igb_main.c 파일의 10845 번째 라인에서 정의되었습니다.

10846 {
10847  struct igb_private_data *igb_priv = file->private_data;
10848  struct igb_adapter *adapter = NULL;
10849  unsigned long size = vma->vm_end - vma->vm_start;
10850  dma_addr_t pgoff = vma->vm_pgoff;
10851  dma_addr_t physaddr;
10852 
10853  if (igb_priv == NULL) {
10854  printk("cannot find private data!\n");
10855  return -ENOENT;
10856  }
10857 
10858  adapter = igb_priv->adapter;
10859  if (adapter == NULL)
10860  return -ENODEV;
10861 
10862  if (pgoff == 0)
10863  physaddr = pci_resource_start(adapter->pdev, 0) >> PAGE_SHIFT;
10864  else
10865  physaddr = pgoff;
10866 
10867  if (remap_pfn_range(vma, vma->vm_start, physaddr, size,
10868  vma->vm_page_prot))
10869  return -EAGAIN;
10870 
10871  vma->vm_ops = &igb_mmap_ops;
10872  return 0;
10873 }
struct igb_adapter * adapter
Definition: igb.h:929
struct pci_dev * pdev
Definition: igb.h:582
static struct vm_operations_struct igb_mmap_ops
Definition: igb_main.c:236
int size
#define NULL
Null pointer value.

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_msg_task ( struct igb_adapter adapter)
static

igb_main.c 파일의 7076 번째 라인에서 정의되었습니다.

7077 {
7078  struct e1000_hw *hw = &adapter->hw;
7079  u32 vf;
7080 
7081  for (vf = 0; vf < adapter->vfs_allocated_count; vf++) {
7082  /* process any reset requests */
7083  if (!e1000_check_for_rst(hw, vf))
7084  igb_vf_reset_event(adapter, vf);
7085 
7086  /* process any messages pending */
7087  if (!e1000_check_for_msg(hw, vf))
7088  igb_rcv_msg_from_vf(adapter, vf);
7089 
7090  /* process any acks */
7091  if (!e1000_check_for_ack(hw, vf))
7092  igb_rcv_ack_from_vf(adapter, vf);
7093  }
7094 }
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
static void igb_rcv_ack_from_vf(struct igb_adapter *adapter, u32 vf)
Definition: igb_main.c:6974
static void igb_vf_reset_event(struct igb_adapter *adapter, u32 vf)
Definition: igb_main.c:6919
struct e1000_dev_spec_vf vf
Definition: e1000_hw.h:772
s32 e1000_check_for_ack(struct e1000_hw *hw, u16 mbx_id)
Definition: e1000_mbx.c:131
static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
Definition: igb_main.c:6988
s32 e1000_check_for_rst(struct e1000_hw *hw, u16 mbx_id)
Definition: e1000_mbx.c:151
u_int32_t u32
Definition: e1000_osdep.h:50
s32 e1000_check_for_msg(struct e1000_hw *hw, u16 mbx_id)
Definition: e1000_mbx.c:111

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static irqreturn_t igb_msix_other ( int  irq,
void *  data 
)
static

igb_main.c 파일의 6197 번째 라인에서 정의되었습니다.

6198 {
6199  struct igb_adapter *adapter = data;
6200  struct e1000_hw *hw = &adapter->hw;
6201  u32 icr = E1000_READ_REG(hw, E1000_ICR);
6202  /* reading ICR causes bit 31 of EICR to be cleared */
6203 
6204  if (icr & E1000_ICR_DRSTA)
6205  schedule_work(&adapter->reset_task);
6206 
6207  if (icr & E1000_ICR_DOUTSYNC) {
6208  /* HW is reporting DMA is out of sync */
6209  adapter->stats.doosync++;
6210  /* The DMA Out of Sync is also indication of a spoof event
6211  * in IOV mode. Check the Wrong VM Behavior register to
6212  * see if it is really a spoof event.
6213  */
6214  igb_check_wvbr(adapter);
6215  }
6216 
6217  /* Check for a mailbox event */
6218  if (icr & E1000_ICR_VMMB)
6219  igb_msg_task(adapter);
6220 
6221  if (icr & E1000_ICR_LSC) {
6222  hw->mac.get_link_status = 1;
6223  /* guard against interrupt when we're going down */
6224  if (!test_bit(__IGB_DOWN, &adapter->state))
6225  mod_timer(&adapter->watchdog_timer, jiffies + 1);
6226  }
6227 
6228 #ifdef HAVE_PTP_1588_CLOCK
6229  if (icr & E1000_ICR_TS)
6230  igb_tsync_interrupt(adapter);
6231 #endif /* HAVE_PTP_1588_CLOCK */
6232 
6233  /* Check for MDD event */
6234  if (icr & E1000_ICR_MDDET)
6235  igb_process_mdd_event(adapter);
6236 
6237  E1000_WRITE_REG(hw, E1000_EIMS, adapter->eims_other);
6238 
6239  return IRQ_HANDLED;
6240 }
static void igb_process_mdd_event(struct igb_adapter *)
Definition: igb_main.c:867
struct e1000_hw hw
Definition: igb.h:594
#define E1000_ICR
Definition: e1000_regs.h:55
static void igb_msg_task(struct igb_adapter *)
Definition: igb_main.c:7076
struct work_struct reset_task
Definition: igb.h:569
u32 eims_other
Definition: igb.h:609
#define E1000_ICR_MDDET
#define E1000_ICR_LSC
#define E1000_ICR_DOUTSYNC
struct e1000_mac_info mac
Definition: e1000_hw.h:762
struct timer_list watchdog_timer
Definition: igb.h:554
static void igb_tsync_interrupt(struct igb_adapter *adapter)
Definition: igb_main.c:6122
#define E1000_ICR_TS
unsigned long state
Definition: igb.h:537
#define E1000_ICR_VMMB
bool get_link_status
Definition: e1000_hw.h:633
#define E1000_ICR_DRSTA
struct e1000_hw_stats stats
Definition: igb.h:595
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_EIMS
Definition: e1000_regs.h:68
u_int32_t u32
Definition: e1000_osdep.h:50
static void igb_check_wvbr(struct igb_adapter *adapter)
Definition: igb_main.c:4637
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static irqreturn_t igb_msix_ring ( int  irq,
void *  data 
)
static

igb_main.c 파일의 6262 번째 라인에서 정의되었습니다.

6263 {
6264  struct igb_q_vector *q_vector = data;
6265 
6266  /* Write the ITR value calculated from the previous interrupt. */
6267  igb_write_itr(q_vector);
6268 
6269  napi_schedule(&q_vector->napi);
6270 
6271  return IRQ_HANDLED;
6272 }
static void igb_write_itr(struct igb_q_vector *q_vector)
Definition: igb_main.c:6242
struct napi_struct napi
Definition: igb.h:421

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_mta_set ( struct igb_adapter adapter,
u32  hash_value 
)

igb_mta_set_ - Set multicast filter table address : pointer to the adapter structure : determines the MTA register and bit to set

The multicast table address is a register array of 32-bit registers. The hash_value is used to determine what register the bit is in, the current value is read, the new bit is OR'd in and the new value is written back into the register.

igb_main.c 파일의 6444 번째 라인에서 정의되었습니다.

6445 {
6446  struct e1000_hw *hw = &adapter->hw;
6447  u32 hash_bit, hash_reg, mta;
6448 
6449  /*
6450  * The MTA is a register array of 32-bit registers. It is
6451  * treated like an array of (32*mta_reg_count) bits. We want to
6452  * set bit BitArray[hash_value]. So we figure out what register
6453  * the bit is in, read it, OR in the new bit, then write
6454  * back the new value. The (hw->mac.mta_reg_count - 1) serves as a
6455  * mask to bits 31:5 of the hash value which gives us the
6456  * register we're modifying. The hash bit within that register
6457  * is determined by the lower 5 bits of the hash value.
6458  */
6459  hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1);
6460  hash_bit = hash_value & 0x1F;
6461 
6462  mta = E1000_READ_REG_ARRAY(hw, E1000_MTA, hash_reg);
6463 
6464  mta |= (1 << hash_bit);
6465 
6466  E1000_WRITE_REG_ARRAY(hw, E1000_MTA, hash_reg, mta);
6467  E1000_WRITE_FLUSH(hw);
6468 }
#define E1000_WRITE_REG_ARRAY(hw, reg, idx, val)
Definition: e1000_osdep.h:100
struct e1000_hw hw
Definition: igb.h:594
#define E1000_READ_REG_ARRAY(hw, reg, idx)
Definition: e1000_osdep.h:103
u16 mta_reg_count
Definition: e1000_hw.h:617
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define E1000_WRITE_FLUSH(a)
Definition: e1000_osdep.h:127
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_MTA
Definition: e1000_regs.h:421

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_ndo_bridge_getlink ( struct sk_buff *  skb,
u32  pid,
u32  seq,
struct net_device *  dev,
u32  filter_mask,
int  nlflags 
)
static

igb_main.c 파일의 2319 번째 라인에서 정의되었습니다.

2329 {
2330  struct igb_adapter *adapter = netdev_priv(dev);
2331  u16 mode;
2332 
2333  if (!(adapter->vfs_allocated_count))
2334  return -EOPNOTSUPP;
2335 
2336  if (adapter->flags & IGB_FLAG_LOOPBACK_ENABLE)
2337  mode = BRIDGE_MODE_VEB;
2338  else
2339  mode = BRIDGE_MODE_VEPA;
2340 #ifdef HAVE_NDO_DFLT_BRIDGE_GETLINK_VLAN_SUPPORT
2341  return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags,
2342  filter_mask, NULL);
2343 #elif defined(HAVE_NDO_BRIDGE_GETLINK_NLFLAGS)
2344  return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags);
2345 #elif defined(NDO_DFLT_BRIDGE_GETLINK_HAS_BRFLAGS)
2346  return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0);
2347 #else
2348  return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode);
2349 #endif /* NDO_DFLT_BRIDGE_GETLINK_HAS_BRFLAGS */
2350 }
unsigned int vfs_allocated_count
Definition: igb.h:621
unsigned int flags
Definition: igb.h:538
static int mode
Definition: rawsock_tx.c:55
u_int16_t u16
Definition: e1000_osdep.h:51
#define BRIDGE_MODE_VEB
Definition: kcompat.h:4102
#define BRIDGE_MODE_VEPA
Definition: kcompat.h:4105
#define IGB_FLAG_LOOPBACK_ENABLE
Definition: igb.h:725
#define NULL
Null pointer value.
static int igb_ndo_bridge_setlink ( struct net_device *  dev,
struct nlmsghdr *  nlh,
u16  flags 
)
static

igb_main.c 파일의 2268 번째 라인에서 정의되었습니다.

2275 {
2276  struct igb_adapter *adapter = netdev_priv(dev);
2277  struct e1000_hw *hw = &adapter->hw;
2278  struct nlattr *attr, *br_spec;
2279  int rem;
2280 
2281  if (!(adapter->vfs_allocated_count))
2282  return -EOPNOTSUPP;
2283 
2284  switch (adapter->hw.mac.type) {
2285  case e1000_82576:
2286  case e1000_i350:
2287  case e1000_i354:
2288  break;
2289  default:
2290  return -EOPNOTSUPP;
2291  }
2292 
2293  br_spec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), IFLA_AF_SPEC);
2294 
2295  nla_for_each_nested(attr, br_spec, rem) {
2296  __u16 mode;
2297 
2298  if (nla_type(attr) != IFLA_BRIDGE_MODE)
2299  continue;
2300 
2301  mode = nla_get_u16(attr);
2302  if (mode == BRIDGE_MODE_VEPA) {
2304  adapter->flags &= ~IGB_FLAG_LOOPBACK_ENABLE;
2305  } else if (mode == BRIDGE_MODE_VEB) {
2307  adapter->flags |= IGB_FLAG_LOOPBACK_ENABLE;
2308  } else
2309  return -EINVAL;
2310 
2311  netdev_info(adapter->netdev, "enabling bridge mode: %s\n",
2312  mode == BRIDGE_MODE_VEPA ? "VEPA" : "VEB");
2313  }
2314 
2315  return 0;
2316 }
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
struct net_device * netdev
Definition: igb.h:535
unsigned int flags
Definition: igb.h:538
void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable)
Definition: e1000_82575.c:2311
static int mode
Definition: rawsock_tx.c:55
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
#define BRIDGE_MODE_VEB
Definition: kcompat.h:4102
#define BRIDGE_MODE_VEPA
Definition: kcompat.h:4105
#define IGB_FLAG_LOOPBACK_ENABLE
Definition: igb.h:725

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static int igb_ndo_fdb_add ( struct ndmsg *  ndm,
struct nlattr *  tb[],
struct net_device *  dev,
const unsigned char *  addr,
u16  vid,
u16  flags 
)
static

igb_main.c 파일의 2169 번째 라인에서 정의되었습니다.

2182 {
2183  struct igb_adapter *adapter = netdev_priv(dev);
2184  struct e1000_hw *hw = &adapter->hw;
2185  int err;
2186 
2187  if (!(adapter->vfs_allocated_count))
2188  return -EOPNOTSUPP;
2189 
2190  /* Hardware does not support aging addresses so if a
2191  * ndm_state is given only allow permanent addresses
2192  */
2193  if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
2194  pr_info("%s: FDB only supports static addresses\n",
2195  igb_driver_name);
2196  return -EINVAL;
2197  }
2198 
2199  if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr)) {
2200  u32 rar_uc_entries = hw->mac.rar_entry_count -
2201  (adapter->vfs_allocated_count + 1);
2202 
2203  if (netdev_uc_count(dev) < rar_uc_entries)
2204  err = dev_uc_add_excl(dev, addr);
2205  else
2206  err = -ENOMEM;
2207  } else if (is_multicast_ether_addr(addr)) {
2208  err = dev_mc_add_excl(dev, addr);
2209  } else {
2210  err = -EINVAL;
2211  }
2212 
2213  /* Only return duplicate errors if NLM_F_EXCL is set */
2214  if (err == -EEXIST && !(flags & NLM_F_EXCL))
2215  err = 0;
2216 
2217  return err;
2218 }
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
int err
struct e1000_mac_info mac
Definition: e1000_hw.h:762
char igb_driver_name[]
Definition: igb_main.c:87
u_int32_t u32
Definition: e1000_osdep.h:50
u16 rar_entry_count
Definition: e1000_hw.h:623
static int igb_open ( struct net_device *  netdev)
static

igb_main.c 파일의 3436 번째 라인에서 정의되었습니다.

3437 {
3438  return __igb_open(netdev, false);
3439 }
static int __igb_open(struct net_device *netdev, bool resuming)
Definition: igb_main.c:3327

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_open_file ( struct inode *  inode,
struct file *  file 
)
static

igb_main.c 파일의 10757 번째 라인에서 정의되었습니다.

10758 {
10759  struct igb_private_data *igb_priv = NULL;
10760  int ret = 0;
10761 
10762  igb_priv = kzalloc(sizeof(struct igb_private_data), GFP_KERNEL);
10763  if (igb_priv == NULL) {
10764  ret = -ENOMEM;
10765  goto out;
10766  }
10767  igb_priv->uring_tx_init = 0;
10768  igb_priv->uring_rx_init = 0;
10769  igb_priv->userpages = NULL;
10770  igb_priv->adapter = NULL;
10771 out:
10772  file->private_data = igb_priv;
10773  return ret;
10774 }
static jack_default_audio_sample_t ** out
Definition: jack_listener.c:75
struct igb_adapter * adapter
Definition: igb.h:929
u32 uring_rx_init
Definition: igb.h:934
u32 uring_tx_init
Definition: igb.h:933
struct igb_user_page * userpages
Definition: igb.h:931
#define NULL
Null pointer value.
static void igb_ping_all_vfs ( struct igb_adapter adapter)
static

igb_main.c 파일의 6420 번째 라인에서 정의되었습니다.

6421 {
6422  struct e1000_hw *hw = &adapter->hw;
6423  u32 ping;
6424  int i;
6425 
6426  for (i = 0 ; i < adapter->vfs_allocated_count; i++) {
6427  ping = E1000_PF_CONTROL_MSG;
6428  if (adapter->vf_data[i].flags & IGB_VF_FLAG_CTS)
6429  ping |= E1000_VT_MSGTYPE_CTS;
6430  e1000_write_mbx(hw, &ping, 1, i);
6431  }
6432 }
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
#define E1000_PF_CONTROL_MSG
Definition: e1000_mbx.h:69
#define IGB_VF_FLAG_CTS
Definition: igb.h:160
struct vf_data_storage * vf_data
Definition: igb.h:615
u32 flags
Definition: igb.h:148
#define E1000_VT_MSGTYPE_CTS
Definition: e1000_mbx.h:52
u_int32_t u32
Definition: e1000_osdep.h:50
s32 e1000_write_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
Definition: e1000_mbx.c:88

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_poll ( struct napi_struct *  napi,
int  budget 
)
static

igb_poll - NAPI Rx polling callback : napi polling structure : count of how many packets we should handle

igb_main.c 파일의 7236 번째 라인에서 정의되었습니다.

7237 {
7238  struct igb_q_vector *q_vector = container_of(napi,
7239  struct igb_q_vector, napi);
7240  bool clean_complete = true;
7241 
7242 #ifdef IGB_DCA
7243  if (q_vector->adapter->flags & IGB_FLAG_DCA_ENABLED)
7244  igb_update_dca(q_vector);
7245 #endif
7246  if (q_vector->tx.ring)
7247  clean_complete = igb_clean_tx_irq(q_vector);
7248 
7249  if (q_vector->rx.ring)
7250  clean_complete &= igb_clean_rx_irq(q_vector, budget);
7251 
7252 #ifndef HAVE_NETDEV_NAPI_LIST
7253  /* if netdev is disabled we need to stop polling */
7254  if (!netif_running(q_vector->adapter->netdev))
7255  clean_complete = true;
7256 
7257 #endif
7258  /* If all work not completed, return budget and keep polling */
7259  if (!clean_complete)
7260  return budget;
7261 
7262  /* If not enough Rx work done, exit the polling mode */
7263  napi_complete(napi);
7264  igb_ring_irq_enable(q_vector);
7265 
7266  return 0;
7267 }
struct net_device * netdev
Definition: igb.h:535
unsigned int flags
Definition: igb.h:538
struct igb_adapter * adapter
Definition: igb.h:411
#define IGB_FLAG_DCA_ENABLED
Definition: igb.h:713
void igb_ring_irq_enable(struct igb_q_vector *q_vector)
Definition: igb_main.c:7210
struct igb_ring_container rx tx
Definition: igb.h:419
static bool igb_clean_rx_irq(struct igb_q_vector *, int)
Definition: igb_main.c:8599
struct napi_struct napi
Definition: igb.h:421
struct igb_ring * ring
Definition: igb.h:357
static bool igb_clean_tx_irq(struct igb_q_vector *)
Definition: igb_main.c:7274

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static unsigned int igb_pollfd ( struct file *  file,
poll_table *  wait 
)
static

igb_main.c 파일의 10212 번째 라인에서 정의되었습니다.

10213 {
10214  return -EINVAL; /* don't support reads for any status or data */
10215 }
static void igb_power_down_link ( struct igb_adapter adapter)
static

igb_power_down_link - Power down the phy/serdes link : address of board private structure

igb_main.c 파일의 1634 번째 라인에서 정의되었습니다.

1635 {
1636  if (adapter->hw.phy.media_type == e1000_media_type_copper)
1637  e1000_power_down_phy(&adapter->hw);
1638  else
1640 }
struct e1000_hw hw
Definition: igb.h:594
struct e1000_phy_info phy
Definition: e1000_hw.h:764
enum e1000_media_type media_type
Definition: e1000_hw.h:657
void e1000_power_down_phy(struct e1000_hw *hw)
Definition: e1000_api.c:1103
void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw)
Definition: e1000_api.c:1127

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_power_up_link ( struct igb_adapter adapter)

igb_power_up_link - Power up the phy/serdes link : address of board private structure

igb_main.c 파일의 1620 번째 라인에서 정의되었습니다.

1621 {
1622  e1000_phy_hw_reset(&adapter->hw);
1623 
1624  if (adapter->hw.phy.media_type == e1000_media_type_copper)
1625  e1000_power_up_phy(&adapter->hw);
1626  else
1628 }
struct e1000_hw hw
Definition: igb.h:594
struct e1000_phy_info phy
Definition: e1000_hw.h:764
s32 e1000_phy_hw_reset(struct e1000_hw *hw)
Definition: e1000_api.c:872
enum e1000_media_type media_type
Definition: e1000_hw.h:657
void e1000_power_up_fiber_serdes_link(struct e1000_hw *hw)
Definition: e1000_api.c:1115
void e1000_power_up_phy(struct e1000_hw *hw)
Definition: e1000_api.c:1088

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_probe ( struct pci_dev *  pdev,
const struct pci_device_id *  ent 
)
static

igb_probe - Device Initialization Routine : PCI device information struct : entry in igb_pci_tbl

Returns 0 on success, negative on failure

igb_probe initializes an adapter identified by a pci_dev structure. The OS initialization, configuring of the adapter private structure, and a hardware reset occur.

igb_main.c 파일의 2627 번째 라인에서 정의되었습니다.

2629 {
2630  struct net_device *netdev;
2631  struct igb_adapter *adapter;
2632  struct e1000_hw *hw;
2633  u16 eeprom_data = 0;
2634  u8 pba_str[E1000_PBANUM_LENGTH];
2635  s32 ret_val;
2636  static int global_quad_port_a; /* global quad port a indication */
2637  int err, pci_using_dac;
2638  static int cards_found;
2639 
2640  err = pci_enable_device_mem(pdev);
2641  if (err)
2642  return err;
2643 
2644  pci_using_dac = 0;
2645 #if !defined(CONFIG_IGB_SUPPORT_32BIT_IOCTL)
2646  err = dma_set_mask(pci_dev_to_dev(pdev), DMA_BIT_MASK(64));
2647  if (!err) {
2648  err = dma_set_coherent_mask(pci_dev_to_dev(pdev),
2649  DMA_BIT_MASK(64));
2650  if (!err)
2651  pci_using_dac = 1;
2652  } else {
2653 #endif
2654  err = dma_set_mask(pci_dev_to_dev(pdev), DMA_BIT_MASK(32));
2655  if (!err) {
2656  err = dma_set_coherent_mask(pci_dev_to_dev(pdev),
2657  DMA_BIT_MASK(32));
2658  if (err) {
2659  IGB_ERR(
2660  "No usable DMA configuration, aborting\n");
2661  goto err_dma;
2662  }
2663  }
2664 #if !defined(CONFIG_IGB_SUPPORT_32BIT_IOCTL)
2665  }
2666 #endif
2667 
2668 #ifndef HAVE_ASPM_QUIRKS
2669  /* 82575 requires that the pci-e link partner disable the L0s state */
2670  switch (pdev->device) {
2674  pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S);
2675  default:
2676  break;
2677  }
2678 
2679 #endif /* HAVE_ASPM_QUIRKS */
2680  err = pci_request_selected_regions(pdev,
2681  pci_select_bars(pdev,
2682  IORESOURCE_MEM),
2683  igb_driver_name);
2684  if (err)
2685  goto err_pci_reg;
2686 
2687  pci_enable_pcie_error_reporting(pdev);
2688 
2689  pci_set_master(pdev);
2690 
2691  err = -ENOMEM;
2692 #ifdef HAVE_TX_MQ
2693  netdev = alloc_etherdev_mq(sizeof(struct igb_adapter),
2695 #else
2696  netdev = alloc_etherdev(sizeof(struct igb_adapter));
2697 #endif /* HAVE_TX_MQ */
2698  if (!netdev)
2699  goto err_alloc_etherdev;
2700 
2701  SET_MODULE_OWNER(netdev);
2702  SET_NETDEV_DEV(netdev, &pdev->dev);
2703 
2704  pci_set_drvdata(pdev, netdev);
2705  adapter = netdev_priv(netdev);
2706  adapter->netdev = netdev;
2707  adapter->pdev = pdev;
2708  hw = &adapter->hw;
2709  hw->back = adapter;
2710  adapter->port_num = hw->bus.func;
2711  adapter->msg_enable = (1 << debug) - 1;
2712 
2713  /* AVB specific */
2714  adapter->uring_tx_init = 0;
2715  adapter->uring_rx_init = 0;
2716  mutex_init(&adapter->lock);
2717 #ifdef HAVE_PCI_ERS
2718  err = pci_save_state(pdev);
2719  if (err)
2720  goto err_ioremap;
2721 #endif
2722  err = -EIO;
2723  hw->hw_addr = ioremap(pci_resource_start(pdev, 0),
2724  pci_resource_len(pdev, 0));
2725  if (!hw->hw_addr)
2726  goto err_ioremap;
2727 
2728 #ifdef HAVE_NET_DEVICE_OPS
2729  netdev->netdev_ops = &igb_netdev_ops;
2730 #else /* HAVE_NET_DEVICE_OPS */
2731  netdev->open = &igb_open;
2732  netdev->stop = &igb_close;
2733  netdev->get_stats = &igb_get_stats;
2734 #ifdef HAVE_SET_RX_MODE
2735  netdev->set_rx_mode = &igb_set_rx_mode;
2736 #endif
2737  netdev->set_multicast_list = &igb_set_rx_mode;
2738  netdev->set_mac_address = &igb_set_mac;
2739  netdev->change_mtu = &igb_change_mtu;
2740  netdev->do_ioctl = &igb_ioctl;
2741 #ifdef HAVE_TX_TIMEOUT
2742  netdev->tx_timeout = &igb_tx_timeout;
2743 #endif
2744  netdev->vlan_rx_register = igb_vlan_mode;
2745  netdev->vlan_rx_add_vid = igb_vlan_rx_add_vid;
2746  netdev->vlan_rx_kill_vid = igb_vlan_rx_kill_vid;
2747 #ifdef CONFIG_NET_POLL_CONTROLLER
2748  netdev->poll_controller = igb_netpoll;
2749 #endif
2750  netdev->hard_start_xmit = &igb_xmit_frame;
2751 #endif /* HAVE_NET_DEVICE_OPS */
2752  igb_set_ethtool_ops(netdev);
2753 #ifdef HAVE_TX_TIMEOUT
2754  netdev->watchdog_timeo = 5 * HZ;
2755 #endif
2756 
2757  strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
2758 
2759  adapter->bd_number = cards_found;
2760 
2761  /* setup the private structure */
2762  err = igb_sw_init(adapter);
2763  if (err)
2764  goto err_sw_init;
2765 
2766  e1000_get_bus_info(hw);
2767 
2769  hw->mac.adaptive_ifs = FALSE;
2770 
2771  /* Copper options */
2772  if (hw->phy.media_type == e1000_media_type_copper) {
2773  hw->phy.mdix = AUTO_ALL_MODES;
2776  }
2777 
2778  if (e1000_check_reset_block(hw))
2779  dev_info(pci_dev_to_dev(pdev),
2780  "PHY reset is blocked due to SOL/IDER session.\n");
2781 
2782  /*
2783  * features is initialized to 0 in allocation, it might have bits
2784  * set by igb_sw_init so we should use an or instead of an
2785  * assignment.
2786  */
2787  netdev->features |= NETIF_F_SG |
2788  NETIF_F_IP_CSUM |
2789 #ifdef NETIF_F_IPV6_CSUM
2790  NETIF_F_IPV6_CSUM |
2791 #endif
2792 #ifdef NETIF_F_TSO
2793  NETIF_F_TSO |
2794 #ifdef NETIF_F_TSO6
2795  NETIF_F_TSO6 |
2796 #endif
2797 #endif /* NETIF_F_TSO */
2798 #ifdef NETIF_F_RXHASH
2799  NETIF_F_RXHASH |
2800 #endif
2801  NETIF_F_RXCSUM |
2802 #ifdef NETIF_F_HW_VLAN_CTAG_RX
2803  NETIF_F_HW_VLAN_CTAG_RX |
2804  NETIF_F_HW_VLAN_CTAG_TX;
2805 #else
2806  NETIF_F_HW_VLAN_RX |
2807  NETIF_F_HW_VLAN_TX;
2808 #endif
2809 
2810  if (hw->mac.type >= e1000_82576)
2811  netdev->features |= NETIF_F_SCTP_CSUM;
2812 
2813 #if defined(HAVE_NDO_SET_FEATURES) && !defined(HAVE_RHEL6_NET_DEVICE_OPS_EXT)
2814  /* copy netdev features into list of user selectable features */
2815  netdev->hw_features |= netdev->features;
2816 #ifndef IGB_NO_LRO
2817 
2818  /* give us the option of enabling LRO later */
2819  netdev->hw_features |= NETIF_F_LRO;
2820 #endif
2821 #else
2822 #ifdef NETIF_F_GRO
2823 
2824  /* this is only needed on kernels prior to 2.6.39 */
2825  netdev->features |= NETIF_F_GRO;
2826 #endif
2827 #endif
2828 
2829  /* set this bit last since it cannot be part of hw_features */
2830 #ifdef NETIF_F_HW_VLAN_CTAG_FILTER
2831  netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
2832 #else
2833  netdev->features |= NETIF_F_HW_VLAN_FILTER;
2834 #endif
2835 
2836 #ifdef HAVE_NETDEV_VLAN_FEATURES
2837  netdev->vlan_features |= NETIF_F_TSO |
2838  NETIF_F_TSO6 |
2839  NETIF_F_IP_CSUM |
2840  NETIF_F_IPV6_CSUM |
2841  NETIF_F_SG;
2842 
2843 #endif
2844  if (pci_using_dac)
2845  netdev->features |= NETIF_F_HIGHDMA;
2846 
2847  adapter->en_mng_pt = e1000_enable_mng_pass_thru(hw);
2848 #ifdef DEBUG
2849  if (adapter->dmac != IGB_DMAC_DISABLE)
2850  netdev_info(netdev, "%s: DMA Coalescing is enabled..\n",
2851  netdev->name);
2852 #endif
2853 
2854  /* before reading the NVM, reset the controller to put the device in a
2855  * known good starting state
2856  */
2857  e1000_reset_hw(hw);
2858 
2859  /* make sure the NVM is good */
2860  if (e1000_validate_nvm_checksum(hw) < 0) {
2861  dev_err(pci_dev_to_dev(pdev),
2862  "The NVM Checksum Is Not Valid\n");
2863  err = -EIO;
2864  goto err_eeprom;
2865  }
2866 
2867  /* copy the MAC address out of the NVM */
2868  if (e1000_read_mac_addr(hw))
2869  dev_err(pci_dev_to_dev(pdev), "NVM Read Error\n");
2870  memcpy(netdev->dev_addr, hw->mac.addr, netdev->addr_len);
2871 #ifdef ETHTOOL_GPERMADDR
2872  memcpy(netdev->perm_addr, hw->mac.addr, netdev->addr_len);
2873 
2874  if (!is_valid_ether_addr(netdev->perm_addr)) {
2875 #else
2876  if (!is_valid_ether_addr(netdev->dev_addr)) {
2877 #endif
2878  dev_err(pci_dev_to_dev(pdev), "Invalid MAC Address\n");
2879  err = -EIO;
2880  goto err_eeprom;
2881  }
2882 
2883  memcpy(&adapter->mac_table[0].addr, hw->mac.addr, netdev->addr_len);
2884  adapter->mac_table[0].queue = adapter->vfs_allocated_count;
2885  adapter->mac_table[0].state = (IGB_MAC_STATE_DEFAULT
2887  igb_rar_set(adapter, 0);
2888 
2889  /* get firmware version for ethtool -i */
2890  igb_set_fw_version(adapter);
2891 
2892  /* Check if Media Autosense is enabled */
2893  if (hw->mac.type == e1000_82580)
2894  igb_init_mas(adapter);
2895 
2896 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
2897  timer_setup(&adapter->watchdog_timer, &igb_watchdog, 0);
2898  if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA)
2899  timer_setup(&adapter->dma_err_timer, &igb_dma_err_timer, 0);
2900  timer_setup(&adapter->phy_info_timer, &igb_update_phy_info, 0);
2901 #else
2902  setup_timer(&adapter->watchdog_timer, &igb_watchdog,
2903  (unsigned long) adapter);
2904  if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA)
2905  setup_timer(&adapter->dma_err_timer, &igb_dma_err_timer,
2906  (unsigned long) adapter);
2907  setup_timer(&adapter->phy_info_timer, &igb_update_phy_info,
2908  (unsigned long) adapter);
2909 #endif
2910 
2911  INIT_WORK(&adapter->reset_task, igb_reset_task);
2912  INIT_WORK(&adapter->watchdog_task, igb_watchdog_task);
2913  if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA)
2914  INIT_WORK(&adapter->dma_err_task, igb_dma_err_task);
2915 
2916  /* Initialize link properties that are user-changeable */
2917  adapter->fc_autoneg = true;
2918  hw->mac.autoneg = true;
2919  hw->phy.autoneg_advertised = 0x2f;
2920 
2923 
2925 
2926  /* By default, support wake on port A */
2927  if (hw->bus.func == 0)
2928  adapter->flags |= IGB_FLAG_WOL_SUPPORTED;
2929 
2930  /* Check the NVM for wake support for non-port A ports */
2931  if (hw->mac.type >= e1000_82580)
2934  &eeprom_data);
2935  else if (hw->bus.func == 1)
2936  e1000_read_nvm(hw, NVM_INIT_CONTROL3_PORT_B, 1, &eeprom_data);
2937 
2938  if (eeprom_data & IGB_EEPROM_APME)
2939  adapter->flags |= IGB_FLAG_WOL_SUPPORTED;
2940 
2941  /* now that we have the eeprom settings, apply the special cases where
2942  * the eeprom may be wrong or the board simply won't support wake on
2943  * lan on a particular port
2944  */
2945  switch (pdev->device) {
2947  adapter->flags &= ~IGB_FLAG_WOL_SUPPORTED;
2948  break;
2952  /* Wake events only supported on port A for dual fiber
2953  * regardless of eeprom setting
2954  */
2956  adapter->flags &= ~IGB_FLAG_WOL_SUPPORTED;
2957  break;
2960  /* if quad port adapter, disable WoL on all but port A */
2961  if (global_quad_port_a != 0)
2962  adapter->flags &= ~IGB_FLAG_WOL_SUPPORTED;
2963  else
2964  adapter->flags |= IGB_FLAG_QUAD_PORT_A;
2965  /* Reset for multiple quad port adapters */
2966  if (++global_quad_port_a == 4)
2967  global_quad_port_a = 0;
2968  break;
2969  default:
2970  break;
2971  }
2972 
2973  /* initialize the wol settings based on the eeprom settings */
2974  if (adapter->flags & IGB_FLAG_WOL_SUPPORTED)
2975  adapter->wol |= E1000_WUFC_MAG;
2976 
2977  /* Some vendors want WoL disabled by default, but still supported */
2978  if ((hw->mac.type == e1000_i350) &&
2979  (pdev->subsystem_vendor == PCI_VENDOR_ID_HP)) {
2980  adapter->flags |= IGB_FLAG_WOL_SUPPORTED;
2981  adapter->wol = 0;
2982  }
2983 
2984  device_set_wakeup_enable(pci_dev_to_dev(adapter->pdev),
2985  adapter->flags & IGB_FLAG_WOL_SUPPORTED);
2986 
2987  /* reset the hardware with the new settings */
2988  igb_reset(adapter);
2989  adapter->devrc = 0;
2990 
2991 #ifdef HAVE_I2C_SUPPORT
2992  /* Init the I2C interface */
2993  err = igb_init_i2c(adapter);
2994  if (err) {
2995  dev_err(&pdev->dev, "failed to init i2c interface\n");
2996  goto err_eeprom;
2997  }
2998 #endif /* HAVE_I2C_SUPPORT */
2999 
3000  /* let the f/w know that the h/w is now under the control of the
3001  * driver.
3002  */
3003  igb_get_hw_control(adapter);
3004 
3005  strncpy(netdev->name, "eth%d", IFNAMSIZ);
3006  err = register_netdev(netdev);
3007  if (err)
3008  goto err_register;
3009 
3010 #ifdef CONFIG_IGB_VMDQ_NETDEV
3011  err = igb_init_vmdq_netdevs(adapter);
3012  if (err)
3013  goto err_register;
3014 #endif
3015  /* carrier off reporting is important to ethtool even BEFORE open */
3016  netif_carrier_off(netdev);
3017 
3018 #ifdef IGB_DCA
3019  if (dca_add_requester(&pdev->dev) == E1000_SUCCESS) {
3020  adapter->flags |= IGB_FLAG_DCA_ENABLED;
3021  dev_info(pci_dev_to_dev(pdev), "DCA enabled\n");
3022  igb_setup_dca(adapter);
3023  }
3024 
3025 #endif
3026 #ifdef HAVE_PTP_1588_CLOCK
3027  /* do hw tstamp init after resetting */
3028  igb_ptp_init(adapter);
3029 #endif /* HAVE_PTP_1588_CLOCK */
3030 
3031  dev_info(pci_dev_to_dev(pdev), "Intel(R) Gigabit Ethernet Network Connection\n");
3032  /* print bus type/speed/width info */
3033  dev_info(pci_dev_to_dev(pdev), "%s: (PCIe:%s:%s) ",
3034  netdev->name,
3035  ((hw->bus.speed == e1000_bus_speed_2500) ? "2.5GT/s" :
3036  (hw->bus.speed == e1000_bus_speed_5000) ? "5.0GT/s" :
3037  (hw->mac.type == e1000_i354) ? "integrated" : "unknown"),
3038  ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" :
3039  (hw->bus.width == e1000_bus_width_pcie_x2) ? "Width x2" :
3040  (hw->bus.width == e1000_bus_width_pcie_x1) ? "Width x1" :
3041  (hw->mac.type == e1000_i354) ? "integrated" : "unknown"));
3042  netdev_info(netdev, "MAC: %pM\n", netdev->dev_addr);
3043 
3044  ret_val = e1000_read_pba_string(hw, pba_str, E1000_PBANUM_LENGTH);
3045  if (ret_val)
3046  strcpy(pba_str, "Unknown");
3047  dev_info(pci_dev_to_dev(pdev), "%s: PBA No: %s\n", netdev->name,
3048  pba_str);
3049 
3050  /* Initialize the thermal sensor on i350 devices. */
3051  if (hw->mac.type == e1000_i350) {
3052  if (hw->bus.func == 0) {
3053  u16 ets_word;
3054 
3055  /*
3056  * Read the NVM to determine if this i350 device
3057  * supports an external thermal sensor.
3058  */
3059  e1000_read_nvm(hw, NVM_ETS_CFG, 1, &ets_word);
3060  if (ets_word != 0x0000 && ets_word != 0xFFFF)
3061  adapter->ets = true;
3062  else
3063  adapter->ets = false;
3064  }
3065 #ifdef IGB_HWMON
3066 
3067  igb_sysfs_init(adapter);
3068 #else
3069 #ifdef IGB_PROCFS
3070 
3071  igb_procfs_init(adapter);
3072 #endif /* IGB_PROCFS */
3073 #endif /* IGB_HWMON */
3074  } else {
3075  adapter->ets = false;
3076  }
3077 
3078  if (hw->phy.media_type == e1000_media_type_copper) {
3079  switch (hw->mac.type) {
3080  case e1000_i350:
3081  case e1000_i210:
3082  case e1000_i211:
3083  /* Enable EEE for internal copper PHY devices */
3084  err = e1000_set_eee_i350(hw, true, true);
3085  if ((!err) &&
3086  (adapter->flags & IGB_FLAG_EEE))
3087  adapter->eee_advert =
3088  MDIO_EEE_100TX | MDIO_EEE_1000T;
3089  break;
3090  case e1000_i354:
3091  if ((E1000_READ_REG(hw, E1000_CTRL_EXT)) &
3093  err = e1000_set_eee_i354(hw, true, true);
3094  if ((!err) &&
3095  (adapter->flags & IGB_FLAG_EEE))
3096  adapter->eee_advert =
3097  MDIO_EEE_100TX | MDIO_EEE_1000T;
3098  }
3099  break;
3100  default:
3101  break;
3102  }
3103  }
3104 
3105  /* send driver version info to firmware */
3106  if ((hw->mac.type >= e1000_i350) &&
3108  igb_init_fw(adapter);
3109 
3110 #ifndef IGB_NO_LRO
3111  if (netdev->features & NETIF_F_LRO)
3112  dev_info(pci_dev_to_dev(pdev), "Internal LRO is enabled\n");
3113  else
3114  dev_info(pci_dev_to_dev(pdev), "LRO is disabled\n");
3115 #endif
3116  dev_info(pci_dev_to_dev(pdev),
3117  "Using %s interrupts. %d rx queue(s), %d tx queue(s)\n",
3118  adapter->msix_entries ? "MSI-X" :
3119  (adapter->flags & IGB_FLAG_HAS_MSI) ? "MSI" : "legacy",
3120  adapter->num_rx_queues, adapter->num_tx_queues);
3121 
3122  cards_found++;
3123 
3124  pm_runtime_put_noidle(&pdev->dev);
3125  return 0;
3126 
3127 err_register:
3128  igb_release_hw_control(adapter);
3129 #ifdef HAVE_I2C_SUPPORT
3130  memset(&adapter->i2c_adap, 0, sizeof(adapter->i2c_adap));
3131 #endif /* HAVE_I2C_SUPPORT */
3132 err_eeprom:
3133  if (!e1000_check_reset_block(hw))
3134  e1000_phy_hw_reset(hw);
3135 
3136  if (hw->flash_address)
3137  iounmap(hw->flash_address);
3138 err_sw_init:
3139  igb_clear_interrupt_scheme(adapter);
3140  igb_reset_sriov_capability(adapter);
3141  iounmap(hw->hw_addr);
3142 err_ioremap:
3143  free_netdev(netdev);
3144 err_alloc_etherdev:
3145  pci_release_selected_regions(pdev,
3146  pci_select_bars(pdev, IORESOURCE_MEM));
3147 err_pci_reg:
3148 err_dma:
3149  pci_disable_device(pdev);
3150  return err;
3151 }
static void igb_get_hw_control(struct igb_adapter *adapter)
Definition: igb_main.c:1564
u16 queue
Definition: igb.h:447
static void igb_tx_timeout(struct net_device *)
Definition: igb_main.c:5802
u32 wol
Definition: igb.h:559
enum e1000_fc_mode requested_mode
Definition: e1000_hw.h:707
struct msix_entry * msix_entries
Definition: igb.h:541
struct e1000_hw hw
Definition: igb.h:594
#define NVM_82580_LAN_FUNC_OFFSET(a)
#define E1000_WUFC_MAG
Definition: e1000_defines.h:42
unsigned int vfs_allocated_count
Definition: igb.h:621
s32 e1000_get_bus_info(struct e1000_hw *hw)
Definition: e1000_api.c:306
#define E1000_STATUS_FUNC_1
int err
u8 addr[ETH_ALEN]
Definition: igb.h:446
static void igb_watchdog_task(struct work_struct *)
Definition: igb_main.c:4779
struct mutex lock
Definition: igb.h:693
u16 eee_advert
Definition: igb.h:688
bool ets
Definition: igb.h:639
static void igb_init_mas(struct igb_adapter *adapter)
Definition: igb_main.c:2557
#define IGB_EEPROM_APME
Definition: igb.h:214
#define E1000_DEV_ID_82576_QUAD_COPPER
Definition: e1000_hw.h:37
static int igb_open(struct net_device *)
Definition: igb_main.c:3436
struct e1000_bus_info bus
Definition: e1000_hw.h:766
#define E1000_CTRL_EXT
Definition: e1000_regs.h:32
struct net_device * netdev
Definition: igb.h:535
#define IGB_FLAG_HAS_MSI
Definition: igb.h:712
struct e1000_phy_info phy
Definition: e1000_hw.h:764
s32 e1000_validate_mdi_setting(struct e1000_hw *hw)
Definition: e1000_api.c:644
#define NETIF_F_SCTP_CSUM
Definition: kcompat.h:216
struct pci_dev * pdev
Definition: igb.h:582
static void igb_release_hw_control(struct igb_adapter *adapter)
Definition: igb_main.c:1544
#define E1000_DEV_ID_82576_QUAD_COPPER_ET2
Definition: e1000_hw.h:38
struct work_struct reset_task
Definition: igb.h:569
#define NVM_ETS_CFG
s32 e1000_phy_hw_reset(struct e1000_hw *hw)
Definition: e1000_api.c:872
unsigned int flags
Definition: igb.h:538
#define IGB_FLAG_QUAD_PORT_A
Definition: igb.h:715
s32 e1000_check_reset_block(struct e1000_hw *hw)
Definition: e1000_api.c:733
#define IGB_FLAG_WOL_SUPPORTED
Definition: igb.h:723
static void igb_set_fw_version(struct igb_adapter *adapter)
Definition: igb_main.c:2508
bool e1000_get_flash_presence_i210(struct e1000_hw *hw)
Definition: e1000_i210.c:685
int msg_enable
Definition: igb.h:605
enum e1000_fc_mode current_mode
Definition: e1000_hw.h:706
static void igb_dma_err_task(struct work_struct *)
Definition: igb_main.c:4973
static void igb_clear_interrupt_scheme(struct igb_adapter *adapter)
Definition: igb_main.c:855
bool e1000_enable_mng_pass_thru(struct e1000_hw *hw)
Definition: e1000_manage.c:331
#define IGB_FLAG_DCA_ENABLED
Definition: igb.h:713
struct e1000_nvm_info nvm
Definition: e1000_hw.h:765
u8 addr[ETH_ADDR_LEN]
Definition: e1000_hw.h:599
int num_tx_queues
Definition: igb.h:547
#define PCIE_LINK_STATE_L0S
Definition: kcompat.h:172
s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
Definition: e1000_api.c:1039
enum e1000_media_type media_type
Definition: e1000_hw.h:657
static int igb_set_mac(struct net_device *, void *)
Definition: igb_main.c:4353
static void igb_watchdog(struct timer_list *)
Definition: igb_main.c:4762
int num_rx_queues
Definition: igb.h:551
struct e1000_mac_info mac
Definition: e1000_hw.h:762
s32 e1000_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M)
Definition: e1000_82575.c:2918
bool disable_polarity_correction
Definition: e1000_hw.h:667
enum e1000_mac_type type
Definition: e1000_hw.h:602
u_int16_t u16
Definition: e1000_osdep.h:51
#define IGB_MAC_STATE_DEFAULT
Definition: igb.h:450
#define SET_NETDEV_DEV(net, pdev)
Definition: kcompat.h:187
struct timer_list phy_info_timer
Definition: igb.h:556
s32 e1000_validate_nvm_checksum(struct e1000_hw *hw)
Definition: e1000_api.c:993
#define IGB_FLAG_EEE
Definition: igb.h:717
bool autoneg_wait_to_complete
Definition: e1000_hw.h:672
struct timer_list watchdog_timer
Definition: igb.h:554
static void igb_update_phy_info(struct timer_list *)
Definition: igb_main.c:4700
int dmac
Definition: igb.h:635
u32 uring_tx_init
Definition: igb.h:584
struct work_struct watchdog_task
Definition: igb.h:570
u8 __iomem * hw_addr
Definition: e1000_hw.h:758
static int igb_close(struct net_device *)
Definition: igb_main.c:3485
u32 uring_rx_init
Definition: igb.h:585
struct e1000_fc_info fc
Definition: e1000_hw.h:763
static void igb_init_fw(struct igb_adapter *adapter)
Definition: igb_main.c:9929
enum e1000_bus_width width
Definition: e1000_hw.h:693
#define FALSE
Definition: maap_log.h:94
void igb_set_ethtool_ops(struct net_device *)
bool fc_autoneg
Definition: igb.h:572
u32 en_mng_pt
Definition: igb.h:560
#define E1000_DEV_ID_82576_FIBER
Definition: e1000_hw.h:35
static int igb_ioctl(struct net_device *, struct ifreq *, int cmd)
Definition: igb_main.c:8891
void * back
Definition: e1000_hw.h:756
u8 port_num
Definition: igb.h:563
s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size)
Definition: e1000_api.c:966
s32 e1000_set_eee_i354(struct e1000_hw *hw, bool adv1G, bool adv100M)
Definition: e1000_82575.c:2973
#define E1000_STATUS
Definition: e1000_regs.h:29
u_int8_t u8
Definition: e1000_osdep.h:52
void igb_vlan_mode(struct net_device *netdev, u32 features)
Definition: igb_main.c:8962
static void igb_set_rx_mode(struct net_device *)
Definition: igb_main.c:4567
static int igb_vlan_rx_add_vid(struct net_device *, u16)
Definition: igb_main.c:9046
s32(* read)(struct e1000_hw *, u16, u16, u16 *)
Definition: e1000_hw.h:575
static int igb_vlan_rx_kill_vid(struct net_device *, u16)
Definition: igb_main.c:9091
#define E1000_CTRL_EXT_LINK_MODE_SGMII
Definition: e1000_defines.h:80
static void igb_dma_err_timer(struct timer_list *)
Definition: igb_main.c:5031
#define IFNAMSIZ
#define E1000_SUCCESS
#define NETIF_F_LRO
Definition: kcompat.h:220
int32_t s32
Definition: e1000_osdep.h:54
static void igb_reset_task(struct work_struct *)
Definition: igb_main.c:5818
enum e1000_bus_speed speed
Definition: e1000_hw.h:692
static int igb_sw_init(struct igb_adapter *)
Definition: igb_main.c:3255
struct igb_mac_addr * mac_table
Definition: igb.h:630
static void igb_reset_sriov_capability(struct igb_adapter *adapter)
Definition: igb_main.c:949
int devrc
Definition: igb.h:685
#define E1000_DEV_ID_82575EB_FIBER_SERDES
Definition: e1000_hw.h:43
#define E1000_DEV_ID_82575EB_COPPER
Definition: e1000_hw.h:42
#define AUTO_ALL_MODES
Definition: igb.h:215
#define E1000_PBANUM_LENGTH
s32 e1000_reset_hw(struct e1000_hw *hw)
Definition: e1000_api.c:423
#define E1000_DEV_ID_82575GB_QUAD_COPPER
Definition: e1000_hw.h:44
static int debug
Definition: igb_main.c:377
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
#define IGB_MAC_STATE_IN_USE
Definition: igb.h:452
static const struct net_device_ops igb_netdev_ops
Definition: igb_main.c:2356
static netdev_tx_t igb_xmit_frame(struct sk_buff *skb, struct net_device *)
Definition: igb_main.c:5770
u16 autoneg_advertised
Definition: e1000_hw.h:659
struct e1000_nvm_operations ops
Definition: e1000_hw.h:676
static struct net_device_stats * igb_get_stats(struct net_device *)
Definition: igb_main.c:5834
#define IGB_DMAC_DISABLE
Definition: igb.h:741
struct work_struct dma_err_task
Definition: igb.h:571
void igb_reset(struct igb_adapter *adapter)
Definition: igb_main.c:1967
u32 bd_number
Definition: igb.h:558
char igb_driver_name[]
Definition: igb_main.c:87
#define IGB_ERR(args...)
Definition: igb.h:72
bool adaptive_ifs
Definition: e1000_hw.h:627
#define E1000_DEV_ID_82576_SERDES
Definition: e1000_hw.h:36
enum e1000_ms_type ms_type
Definition: e1000_hw.h:647
#define IGB_FLAG_DETECT_BAD_DMA
Definition: igb.h:719
u8 __iomem * flash_address
Definition: e1000_hw.h:759
s32 e1000_read_mac_addr(struct e1000_hw *hw)
Definition: e1000_api.c:947
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
struct timer_list dma_err_timer
Definition: igb.h:555
#define NVM_INIT_CONTROL3_PORT_A
void igb_rar_set(struct igb_adapter *adapter, u32 index)
Definition: igb_main.c:2589
u16 state
Definition: igb.h:448
#define NVM_INIT_CONTROL3_PORT_B
static int igb_change_mtu(struct net_device *, int)
Definition: igb_main.c:5857
#define IGB_MAX_TX_QUEUES
Definition: igb.h:129

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_process_mdd_event ( struct igb_adapter adapter)
static

igb_process_mdd_event - board private structure

Identify a malicious VF, disable the VF TX/RX queues and log a message.

igb_main.c 파일의 867 번째 라인에서 정의되었습니다.

868 {
869  struct e1000_hw *hw = &adapter->hw;
870  u32 lvmmc, vfte, vfre, mdfb;
871  u8 vf_queue;
872 
873  lvmmc = E1000_READ_REG(hw, E1000_LVMMC);
874  vf_queue = lvmmc >> 29;
875 
876  /* VF index cannot be bigger or equal to VFs allocated */
877  if (vf_queue >= adapter->vfs_allocated_count)
878  return;
879 
880  netdev_info(adapter->netdev,
881  "VF %d misbehaved. VF queues are disabled. VM misbehavior code is 0x%x\n",
882  vf_queue, lvmmc);
883 
884  /* Disable VFTE and VFRE related bits */
885  vfte = E1000_READ_REG(hw, E1000_VFTE);
886  vfte &= ~(1 << vf_queue);
887  E1000_WRITE_REG(hw, E1000_VFTE, vfte);
888 
889  vfre = E1000_READ_REG(hw, E1000_VFRE);
890  vfre &= ~(1 << vf_queue);
891  E1000_WRITE_REG(hw, E1000_VFRE, vfre);
892 
893  /* Disable MDFB related bit. Clear on write */
894  mdfb = E1000_READ_REG(hw, E1000_MDFB);
895  mdfb |= (1 << vf_queue);
896  E1000_WRITE_REG(hw, E1000_MDFB, mdfb);
897 
898  /* Reset the specific VF */
900 }
#define E1000_VTCTRL(_n)
Definition: e1000_regs.h:517
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
#define E1000_VFRE
Definition: e1000_regs.h:490
struct net_device * netdev
Definition: igb.h:535
#define E1000_LVMMC
Definition: e1000_regs.h:502
u_int8_t u8
Definition: e1000_osdep.h:52
#define E1000_VTCTRL_RST
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_MDFB
Definition: e1000_regs.h:501
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_VFTE
Definition: e1000_regs.h:491
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_process_skb_fields ( struct igb_ring rx_ring,
union e1000_adv_rx_desc rx_desc,
struct sk_buff *  skb 
)
static

igb_process_skb_fields - Populate skb header fields from Rx descriptor : rx descriptor ring packet is being transacted on : pointer to the EOP Rx descriptor : pointer to current skb being populated

This function checks the ring, descriptor, and packet information in order to populate the hash, checksum, VLAN, timestamp, protocol, and other fields within the skb.

igb_main.c 파일의 8167 번째 라인에서 정의되었습니다.

8170 {
8171  struct net_device *dev = rx_ring->netdev;
8172  __le16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info;
8173  bool notype;
8174 
8175 #ifdef NETIF_F_RXHASH
8176  igb_rx_hash(rx_ring, rx_desc, skb);
8177 
8178 #endif
8179  igb_rx_checksum(rx_ring, rx_desc, skb);
8180 
8181  /* update packet type stats */
8182  switch (pkt_info & E1000_RXDADV_PKTTYPE_ILMASK) {
8184  rx_ring->pkt_stats.ipv4_packets++;
8185  break;
8187  rx_ring->pkt_stats.ipv4e_packets++;
8188  break;
8190  rx_ring->pkt_stats.ipv6_packets++;
8191  break;
8193  rx_ring->pkt_stats.ipv6e_packets++;
8194  break;
8195  default:
8196  notype = true;
8197  break;
8198  }
8199 
8200  switch (pkt_info & E1000_RXDADV_PKTTYPE_TLMASK) {
8202  rx_ring->pkt_stats.tcp_packets++;
8203  break;
8205  rx_ring->pkt_stats.udp_packets++;
8206  break;
8208  rx_ring->pkt_stats.sctp_packets++;
8209  break;
8211  rx_ring->pkt_stats.nfs_packets++;
8212  break;
8214  if (notype)
8215  rx_ring->pkt_stats.other_packets++;
8216  break;
8217  default:
8218  break;
8219  }
8220 
8221 #ifdef HAVE_PTP_1588_CLOCK
8222  if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TS) &&
8224  igb_ptp_rx_rgtstamp(rx_ring->q_vector, skb);
8225 
8226 #endif /* HAVE_PTP_1588_CLOCK */
8227 #ifdef NETIF_F_HW_VLAN_CTAG_RX
8228  if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
8229 #else
8230  if ((dev->features & NETIF_F_HW_VLAN_RX) &&
8231 #endif
8232  igb_test_staterr(rx_desc, E1000_RXD_STAT_VP)) {
8233  u16 vid = 0;
8234 
8235  if (igb_test_staterr(rx_desc, E1000_RXDEXT_STATERR_LB) &&
8236  test_bit(IGB_RING_FLAG_RX_LB_VLAN_BSWAP, &rx_ring->flags))
8237  vid = be16_to_cpu(rx_desc->wb.upper.vlan);
8238  else
8239  vid = le16_to_cpu(rx_desc->wb.upper.vlan);
8240 #ifdef HAVE_VLAN_RX_REGISTER
8241  IGB_CB(skb)->vid = vid;
8242  } else {
8243  IGB_CB(skb)->vid = 0;
8244 #else
8245  __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid);
8246 #endif
8247  }
8248 
8249  skb_record_rx_queue(skb, rx_ring->queue_index);
8250 
8251  skb->protocol = eth_type_trans(skb, dev);
8252 }
#define E1000_RXDADV_STAT_TS
Definition: e1000_82575.h:219
#define E1000_RXDADV_PKTTYPE_NFS
Definition: e1000_82575.h:246
#define E1000_RXDADV_PKTTYPE_IPV4
Definition: e1000_82575.h:239
u64 ipv6_packets
Definition: igb.h:347
#define E1000_RXD_STAT_VP
#define IGB_CB(skb)
Definition: igb.h:271
u8 queue_index
Definition: igb.h:380
u64 other_packets
Definition: igb.h:353
struct e1000_adv_rx_desc::@29::@31 upper
u64 ipv4_packets
Definition: igb.h:345
u_int16_t u16
Definition: e1000_osdep.h:51
#define E1000_RXDADV_PKTTYPE_ILMASK
Definition: e1000_82575.h:236
#define __le16
Definition: e1000_hw.h:211
static void igb_rx_checksum(struct igb_ring *ring, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb)
Definition: igb_main.c:7670
struct net_device * netdev
Definition: igb.h:367
u64 ipv4e_packets
Definition: igb.h:346
#define E1000_RXDADV_PKTTYPE_IPV6
Definition: e1000_82575.h:241
#define E1000_RXDADV_PKTTYPE_NONE
Definition: e1000_82575.h:238
#define E1000_RXDADV_PKTTYPE_TLMASK
Definition: e1000_82575.h:237
static __le32 igb_test_staterr(union e1000_adv_rx_desc *rx_desc, const u32 stat_err_bits)
Definition: igb.h:474
#define E1000_RXDADV_PKTTYPE_TCP
Definition: e1000_82575.h:243
struct e1000_adv_rx_desc::@29 wb
#define E1000_RXDADV_PKTTYPE_IPV4_EX
Definition: e1000_82575.h:240
struct e1000_adv_rx_desc::@29::@30 lower
u64 ipv6e_packets
Definition: igb.h:348
unsigned long flags
Definition: igb.h:374
u64 sctp_packets
Definition: igb.h:351
#define E1000_RXDADV_PKTTYPE_IPV6_EX
Definition: e1000_82575.h:242
#define E1000_RXDADV_PKTTYPE_UDP
Definition: e1000_82575.h:244
#define E1000_RXDEXT_STATERR_LB
struct igb_rx_packet_stats pkt_stats
Definition: igb.h:396
struct igb_q_vector * q_vector
Definition: igb.h:366
#define E1000_RXDADV_PKTTYPE_SCTP
Definition: e1000_82575.h:245
#define ETH_P_8021Q
Definition: kcompat.h:148
#define E1000_RXDADV_STAT_TSIP
Definition: e1000_82575.h:220

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_pull_tail ( struct igb_ring rx_ring,
union e1000_adv_rx_desc rx_desc,
struct sk_buff *  skb 
)
static

igb_pull_tail - igb specific version of skb_pull_tail : rx descriptor ring packet is being transacted on : pointer to the EOP Rx descriptor : pointer to current skb being adjusted

This function is an igb specific version of __pskb_pull_tail. The main difference between this version and the original function is that this function can make several assumptions about the state of things that allow for significant optimizations versus the standard function. As a result we can do things like drop a frag and maintain an accurate truesize for the skb.

igb_main.c 파일의 8506 번째 라인에서 정의되었습니다.

8509 {
8510  struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[0];
8511  unsigned char *va;
8512  unsigned int pull_len;
8513 
8514  /*
8515  * it is valid to use page_address instead of kmap since we are
8516  * working with pages allocated out of the lomem pool per
8517  * alloc_page(GFP_ATOMIC)
8518  */
8519  va = skb_frag_address(frag);
8520 
8521 #ifdef HAVE_PTP_1588_CLOCK
8522  if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP)) {
8523  /* retrieve timestamp from buffer */
8524  igb_ptp_rx_pktstamp(rx_ring->q_vector, va, skb);
8525 
8526  /* update pointers to remove timestamp header */
8527  skb_frag_size_sub(frag, IGB_TS_HDR_LEN);
8528  frag->page_offset += IGB_TS_HDR_LEN;
8529  skb->data_len -= IGB_TS_HDR_LEN;
8530  skb->len -= IGB_TS_HDR_LEN;
8531 
8532  /* move va to start of packet data */
8533  va += IGB_TS_HDR_LEN;
8534  }
8535 #endif /* HAVE_PTP_1588_CLOCK */
8536 
8537  /*
8538  * we need the header to contain the greater of either ETH_HLEN or
8539  * 60 bytes if the skb->len is less than 60 for skb_pad.
8540  */
8541  pull_len = igb_get_headlen(va, IGB_RX_HDR_LEN);
8542 
8543  /* align pull length to size of long to optimize memcpy performance */
8544  skb_copy_to_linear_data(skb, va, ALIGN(pull_len, sizeof(long)));
8545 
8546  /* update all of the pointers */
8547  skb_frag_size_sub(frag, pull_len);
8548  frag->page_offset += pull_len;
8549  skb->data_len -= pull_len;
8550  skb->tail += pull_len;
8551 }
#define IGB_RX_HDR_LEN
Definition: igb.h:196
static __le32 igb_test_staterr(union e1000_adv_rx_desc *rx_desc, const u32 stat_err_bits)
Definition: igb.h:474
#define IGB_TS_HDR_LEN
Definition: igb.h:757
static unsigned int igb_get_headlen(unsigned char *data, unsigned int max_len)
Definition: igb_main.c:8394
struct igb_q_vector * q_vector
Definition: igb.h:366
#define E1000_RXDADV_STAT_TSIP
Definition: e1000_82575.h:220

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_rar_set ( struct igb_adapter adapter,
u32  index 
)

igb_main.c 파일의 2589 번째 라인에서 정의되었습니다.

2590 {
2591  u32 rar_low, rar_high;
2592  struct e1000_hw *hw = &adapter->hw;
2593  u8 *addr = adapter->mac_table[index].addr;
2594  /* HW expects these in little endian so we reverse the byte order
2595  * from network order (big endian) to little endian
2596  */
2597  rar_low = ((u32) addr[0] | ((u32) addr[1] << 8) |
2598  ((u32) addr[2] << 16) | ((u32) addr[3] << 24));
2599  rar_high = ((u32) addr[4] | ((u32) addr[5] << 8));
2600 
2601  /* Indicate to hardware the Address is Valid. */
2602  if (adapter->mac_table[index].state & IGB_MAC_STATE_IN_USE)
2603  rar_high |= E1000_RAH_AV;
2604 
2605  if (hw->mac.type == e1000_82575)
2606  rar_high |= E1000_RAH_POOL_1 * adapter->mac_table[index].queue;
2607  else
2608  rar_high |= E1000_RAH_POOL_1 << adapter->mac_table[index].queue;
2609 
2610  E1000_WRITE_REG(hw, E1000_RAL(index), rar_low);
2611  E1000_WRITE_FLUSH(hw);
2612  E1000_WRITE_REG(hw, E1000_RAH(index), rar_high);
2613  E1000_WRITE_FLUSH(hw);
2614 }
u16 queue
Definition: igb.h:447
struct e1000_hw hw
Definition: igb.h:594
#define E1000_RAH(_i)
Definition: e1000_regs.h:230
u8 addr[ETH_ALEN]
Definition: igb.h:446
#define E1000_RAL(_i)
Definition: e1000_regs.h:228
#define E1000_RAH_POOL_1
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
#define E1000_WRITE_FLUSH(a)
Definition: e1000_osdep.h:127
u_int8_t u8
Definition: e1000_osdep.h:52
struct igb_mac_addr * mac_table
Definition: igb.h:630
#define IGB_MAC_STATE_IN_USE
Definition: igb.h:452
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_RAH_AV
u16 state
Definition: igb.h:448

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_rar_set_qsel ( struct igb_adapter adapter,
u8 addr,
u32  index,
u8  qsel 
)
static

igb_main.c 파일의 4478 번째 라인에서 정의되었습니다.

4480 {
4481  u32 rar_low, rar_high;
4482  struct e1000_hw *hw = &adapter->hw;
4483 
4484  /* HW expects these in little endian so we reverse the byte order
4485  * from network order (big endian) to little endian
4486  */
4487  rar_low = ((u32) addr[0] | ((u32) addr[1] << 8) |
4488  ((u32) addr[2] << 16) | ((u32) addr[3] << 24));
4489  rar_high = ((u32) addr[4] | ((u32) addr[5] << 8));
4490 
4491  /* Indicate to hardware the Address is Valid. */
4492  rar_high |= E1000_RAH_AV;
4493 
4494  if (hw->mac.type == e1000_82575)
4495  rar_high |= E1000_RAH_POOL_1 * qsel;
4496  else
4497  rar_high |= E1000_RAH_POOL_1 << qsel;
4498 
4499  E1000_WRITE_REG(hw, E1000_RAL(index), rar_low);
4500  E1000_WRITE_FLUSH(hw);
4501  E1000_WRITE_REG(hw, E1000_RAH(index), rar_high);
4502  E1000_WRITE_FLUSH(hw);
4503 }
struct e1000_hw hw
Definition: igb.h:594
#define E1000_RAH(_i)
Definition: e1000_regs.h:230
#define E1000_RAL(_i)
Definition: e1000_regs.h:228
#define E1000_RAH_POOL_1
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
#define E1000_WRITE_FLUSH(a)
Definition: e1000_osdep.h:127
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_RAH_AV

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_rcv_ack_from_vf ( struct igb_adapter adapter,
u32  vf 
)
static

igb_main.c 파일의 6974 번째 라인에서 정의되었습니다.

6975 {
6976  struct e1000_hw *hw = &adapter->hw;
6977  struct vf_data_storage *vf_data = &adapter->vf_data[vf];
6979 
6980  /* if device isn't clear to send it shouldn't be reading either */
6981  if (!(vf_data->flags & IGB_VF_FLAG_CTS) &&
6982  time_after(jiffies, vf_data->last_nack + (2 * HZ))) {
6983  e1000_write_mbx(hw, &msg, 1, vf);
6984  vf_data->last_nack = jiffies;
6985  }
6986 }
static char msg[LOG_MSG_LEN]
#define E1000_VT_MSGTYPE_NACK
Definition: e1000_mbx.h:50
struct e1000_hw hw
Definition: igb.h:594
#define IGB_VF_FLAG_CTS
Definition: igb.h:160
struct vf_data_storage * vf_data
Definition: igb.h:615
u32 flags
Definition: igb.h:148
u_int32_t u32
Definition: e1000_osdep.h:50
s32 e1000_write_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
Definition: e1000_mbx.c:88
unsigned long last_nack
Definition: igb.h:149

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_rcv_msg_from_vf ( struct igb_adapter adapter,
u32  vf 
)
static

igb_main.c 파일의 6988 번째 라인에서 정의되었습니다.

6989 {
6990  struct pci_dev *pdev = adapter->pdev;
6992  struct e1000_hw *hw = &adapter->hw;
6993  struct vf_data_storage *vf_data = &adapter->vf_data[vf];
6994  s32 retval;
6995 
6996  retval = e1000_read_mbx(hw, msgbuf, E1000_VFMAILBOX_SIZE, vf);
6997 
6998  if (retval) {
6999  dev_err(pci_dev_to_dev(pdev), "Error receiving message from VF\n");
7000  return;
7001  }
7002 
7003  /* this is a message we already processed, do nothing */
7004  if (msgbuf[0] & (E1000_VT_MSGTYPE_ACK | E1000_VT_MSGTYPE_NACK))
7005  return;
7006 
7007  /*
7008  * until the vf completes a reset it should not be
7009  * allowed to start any configuration.
7010  */
7011 
7012  if (msgbuf[0] == E1000_VF_RESET) {
7013  igb_vf_reset_msg(adapter, vf);
7014  return;
7015  }
7016 
7017  if (!(vf_data->flags & IGB_VF_FLAG_CTS)) {
7018  msgbuf[0] = E1000_VT_MSGTYPE_NACK;
7019  if (time_after(jiffies, vf_data->last_nack + (2 * HZ))) {
7020  e1000_write_mbx(hw, msgbuf, 1, vf);
7021  vf_data->last_nack = jiffies;
7022  }
7023  return;
7024  }
7025 
7026  switch ((msgbuf[0] & 0xFFFF)) {
7027  case E1000_VF_SET_MAC_ADDR:
7028  retval = -EINVAL;
7029 #ifndef IGB_DISABLE_VF_MAC_SET
7030  if (!(vf_data->flags & IGB_VF_FLAG_PF_SET_MAC))
7031  retval = igb_set_vf_mac_addr(adapter, msgbuf, vf);
7032  else
7033  DPRINTK(DRV, INFO,
7034  "VF %d attempted to override administratively set MAC address\nReload the VF driver to resume operations\n",
7035  vf);
7036 #endif
7037  break;
7038  case E1000_VF_SET_PROMISC:
7039  retval = igb_set_vf_promisc(adapter, msgbuf, vf);
7040  break;
7042  retval = igb_set_vf_multicasts(adapter, msgbuf, vf);
7043  break;
7044  case E1000_VF_SET_LPE:
7045  retval = igb_set_vf_rlpml(adapter, msgbuf[1], vf);
7046  break;
7047  case E1000_VF_SET_VLAN:
7048  retval = -1;
7049 #ifdef IFLA_VF_MAX
7050  if (vf_data->pf_vlan)
7051  DPRINTK(DRV, INFO,
7052  "VF %d attempted to override administratively set VLAN tag\nReload the VF driver to resume operations\n",
7053  vf);
7054  else
7055 #endif
7056  retval = igb_set_vf_vlan(adapter, msgbuf, vf);
7057  break;
7058  default:
7059  dev_err(pci_dev_to_dev(pdev), "Unhandled Msg %08x\n",
7060  msgbuf[0]);
7061  retval = -E1000_ERR_MBX;
7062  break;
7063  }
7064 
7065  /* notify the VF of the results of what it sent us */
7066  if (retval)
7067  msgbuf[0] |= E1000_VT_MSGTYPE_NACK;
7068  else
7069  msgbuf[0] |= E1000_VT_MSGTYPE_ACK;
7070 
7071  msgbuf[0] |= E1000_VT_MSGTYPE_CTS;
7072 
7073  e1000_write_mbx(hw, msgbuf, 1, vf);
7074 }
#define E1000_VT_MSGTYPE_NACK
Definition: e1000_mbx.h:50
struct e1000_hw hw
Definition: igb.h:594
#define E1000_VF_SET_VLAN
Definition: e1000_mbx.h:62
#define E1000_VFMAILBOX_SIZE
Definition: e1000_mbx.h:41
static int igb_set_vf_vlan(struct igb_adapter *adapter, u32 *msgbuf, u32 vf)
Definition: igb_main.c:6813
#define IGB_VF_FLAG_PF_SET_MAC
Definition: igb.h:163
struct pci_dev * pdev
Definition: igb.h:582
static int igb_set_vf_promisc(struct igb_adapter *adapter, u32 *msgbuf, u32 vf)
Definition: igb_main.c:6470
#define E1000_VT_MSGTYPE_ACK
Definition: e1000_mbx.h:48
#define E1000_VF_SET_PROMISC
Definition: e1000_mbx.h:65
#define E1000_VF_SET_LPE
Definition: e1000_mbx.h:64
static int igb_set_vf_rlpml(struct igb_adapter *adapter, int size, int vfn)
Definition: igb_main.c:3900
#define E1000_VF_SET_MAC_ADDR
Definition: e1000_mbx.h:58
#define DPRINTK(nlevel, klevel, fmt, args...)
Definition: igb.h:75
#define E1000_VF_SET_MULTICAST
Definition: e1000_mbx.h:59
#define E1000_VF_RESET
Definition: e1000_mbx.h:57
#define IGB_VF_FLAG_CTS
Definition: igb.h:160
struct vf_data_storage * vf_data
Definition: igb.h:615
char * msgbuf
Definition: mrpValidate.c:75
static void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf)
Definition: igb_main.c:6931
#define E1000_ERR_MBX
int32_t s32
Definition: e1000_osdep.h:54
u32 flags
Definition: igb.h:148
#define E1000_VT_MSGTYPE_CTS
Definition: e1000_mbx.h:52
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
s32 e1000_read_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
Definition: e1000_mbx.c:62
static int igb_set_vf_multicasts(struct igb_adapter *adapter, u32 *msgbuf, u32 vf)
Definition: igb_main.c:6519
u_int32_t u32
Definition: e1000_osdep.h:50
s32 e1000_write_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
Definition: e1000_mbx.c:88
unsigned long last_nack
Definition: igb.h:149
static int igb_set_vf_mac_addr(struct igb_adapter *adapter, u32 *msg, int vf)
Definition: igb_main.c:6959

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static ssize_t igb_read ( struct file *  file,
char __user *  buf,
size_t  count,
loff_t *  pos 
)
static

igb_main.c 파일의 10217 번째 라인에서 정의되었습니다.

10219 {
10220  return -EINVAL; /* don't support reads for any status or data */
10221 }
void igb_reinit_locked ( struct igb_adapter adapter)

igb_main.c 파일의 1935 번째 라인에서 정의되었습니다.

1936 {
1937  WARN_ON(in_interrupt());
1938  while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
1939  usleep_range(1000, 2000);
1940  igb_down(adapter);
1941  igb_up(adapter);
1942  clear_bit(__IGB_RESETTING, &adapter->state);
1943 }
#define WARN_ON(x)
Definition: kcompat.h:259
void igb_down(struct igb_adapter *adapter)
Definition: igb_main.c:1875
void igb_up(struct igb_adapter *adapter)
Definition: igb_main.c:1829
unsigned long state
Definition: igb.h:537

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_release_hw_control ( struct igb_adapter adapter)
static

igb_release_hw_control - release control of the h/w to f/w : address of board private structure

igb_release_hw_control resets CTRL_EXT:DRV_LOAD bit. For ASF and Pass Through versions of f/w this means that the driver is no longer loaded.

igb_main.c 파일의 1544 번째 라인에서 정의되었습니다.

1545 {
1546  struct e1000_hw *hw = &adapter->hw;
1547  u32 ctrl_ext;
1548 
1549  /* Let firmware take over control of h/w */
1550  ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
1552  ctrl_ext & ~E1000_CTRL_EXT_DRV_LOAD);
1553 }
struct e1000_hw hw
Definition: igb.h:594
#define E1000_CTRL_EXT
Definition: e1000_regs.h:32
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_CTRL_EXT_DRV_LOAD
Definition: e1000_defines.h:83
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_remove ( struct pci_dev *  pdev)
static

igb_remove - Device Removal Routine : PCI device information struct

igb_remove is called by the PCI subsystem to alert the driver that it should release a PCI device. The could be caused by a Hot-Plug event, or because the driver is going to be removed from memory.

igb_main.c 파일의 3175 번째 라인에서 정의되었습니다.

3176 {
3177  struct net_device *netdev = pci_get_drvdata(pdev);
3178  struct igb_adapter *adapter = netdev_priv(netdev);
3179  struct e1000_hw *hw = &adapter->hw;
3180 
3181  pm_runtime_get_noresume(&pdev->dev);
3182 #ifdef HAVE_I2C_SUPPORT
3183  igb_remove_i2c(adapter);
3184 #endif /* HAVE_I2C_SUPPORT */
3185 #ifdef HAVE_PTP_1588_CLOCK
3186  igb_ptp_stop(adapter);
3187 #endif /* HAVE_PTP_1588_CLOCK */
3188 
3189  /* flush_scheduled work may reschedule our watchdog task, so
3190  * explicitly disable watchdog tasks from being rescheduled
3191  */
3192  set_bit(__IGB_DOWN, &adapter->state);
3193  del_timer_sync(&adapter->watchdog_timer);
3194  if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA)
3195  del_timer_sync(&adapter->dma_err_timer);
3196  del_timer_sync(&adapter->phy_info_timer);
3197 
3198  flush_scheduled_work();
3199 
3200 #ifdef IGB_DCA
3201  if (adapter->flags & IGB_FLAG_DCA_ENABLED) {
3202  dev_info(pci_dev_to_dev(pdev), "DCA disabled\n");
3203  dca_remove_requester(&pdev->dev);
3204  adapter->flags &= ~IGB_FLAG_DCA_ENABLED;
3206  }
3207 #endif
3208 
3209 #ifdef CONFIG_IGB_VMDQ_NETDEV
3210  igb_remove_vmdq_netdevs(adapter);
3211 #endif
3212 
3213  igb_reset_sriov_capability(adapter);
3214 
3215  /* Release control of h/w to f/w. If f/w is AMT enabled, this
3216  * would have already happened in close and is redundant.
3217  */
3218  igb_release_hw_control(adapter);
3219 
3220  unregister_netdev(netdev);
3221 
3222  igb_clear_interrupt_scheme(adapter);
3223 
3224  iounmap(hw->hw_addr);
3225  if (hw->flash_address)
3226  iounmap(hw->flash_address);
3227  pci_release_selected_regions(pdev,
3228  pci_select_bars(pdev, IORESOURCE_MEM));
3229 
3230 #ifdef IGB_HWMON
3231  igb_sysfs_exit(adapter);
3232 #else
3233 #ifdef IGB_PROCFS
3234  igb_procfs_exit(adapter);
3235 #endif /* IGB_PROCFS */
3236 #endif /* IGB_HWMON */
3237  kfree(adapter->mac_table);
3238  kfree(adapter->shadow_vfta);
3239  mutex_destroy(&adapter->lock);
3240  free_netdev(netdev);
3241 
3242  pci_disable_pcie_error_reporting(pdev);
3243 
3244  pci_disable_device(pdev);
3245 }
struct e1000_hw hw
Definition: igb.h:594
struct mutex lock
Definition: igb.h:693
static void igb_release_hw_control(struct igb_adapter *adapter)
Definition: igb_main.c:1544
unsigned int flags
Definition: igb.h:538
static void igb_clear_interrupt_scheme(struct igb_adapter *adapter)
Definition: igb_main.c:855
#define IGB_FLAG_DCA_ENABLED
Definition: igb.h:713
struct timer_list phy_info_timer
Definition: igb.h:556
struct timer_list watchdog_timer
Definition: igb.h:554
u8 __iomem * hw_addr
Definition: e1000_hw.h:758
#define E1000_DCA_CTRL
Definition: e1000_regs.h:468
unsigned long state
Definition: igb.h:537
#define E1000_DCA_CTRL_DCA_DISABLE
Definition: e1000_82575.h:344
u32 * shadow_vfta
Definition: igb.h:636
struct igb_mac_addr * mac_table
Definition: igb.h:630
static void igb_reset_sriov_capability(struct igb_adapter *adapter)
Definition: igb_main.c:949
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define IGB_FLAG_DETECT_BAD_DMA
Definition: igb.h:719
u8 __iomem * flash_address
Definition: e1000_hw.h:759
struct timer_list dma_err_timer
Definition: igb.h:555

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static int igb_request_irq ( struct igb_adapter adapter)
static

igb_request_irq - initialize interrupts

Attempts to configure interrupts using the best available capabilities of the hardware and kernel.

igb_main.c 파일의 1371 번째 라인에서 정의되었습니다.

1372 {
1373  struct net_device *netdev = adapter->netdev;
1374  struct pci_dev *pdev = adapter->pdev;
1375  int err = 0;
1376 
1377  if (adapter->msix_entries) {
1378  err = igb_request_msix(adapter);
1379  if (!err)
1380  goto request_done;
1381  /* fall back to MSI */
1382  igb_free_all_tx_resources(adapter);
1383  igb_free_all_rx_resources(adapter);
1384 
1385  igb_clear_interrupt_scheme(adapter);
1386  igb_reset_sriov_capability(adapter);
1387  err = igb_init_interrupt_scheme(adapter, false);
1388  if (err)
1389  goto request_done;
1390  igb_setup_all_tx_resources(adapter);
1391  igb_setup_all_rx_resources(adapter);
1392  igb_configure(adapter);
1393  }
1394 
1395  igb_assign_vector(adapter->q_vector[0], 0);
1396 
1397  if (adapter->flags & IGB_FLAG_HAS_MSI) {
1398  err = request_irq(pdev->irq, &igb_intr_msi, 0,
1399  netdev->name, adapter);
1400  if (!err)
1401  goto request_done;
1402 
1403  /* fall back to legacy interrupts */
1405  adapter->flags &= ~IGB_FLAG_HAS_MSI;
1406  }
1407 
1408  err = request_irq(pdev->irq, &igb_intr, IRQF_SHARED,
1409  netdev->name, adapter);
1410 
1411  if (err)
1412  dev_err(pci_dev_to_dev(pdev), "Error %d getting interrupt\n",
1413  err);
1414 
1415 request_done:
1416  return err;
1417 }
struct msix_entry * msix_entries
Definition: igb.h:541
int err
static irqreturn_t igb_intr_msi(int irq, void *)
Definition: igb_main.c:7128
static void igb_reset_interrupt_capability(struct igb_adapter *adapter)
Definition: igb_main.c:811
static irqreturn_t igb_intr(int irq, void *)
Definition: igb_main.c:7167
struct net_device * netdev
Definition: igb.h:535
#define IGB_FLAG_HAS_MSI
Definition: igb.h:712
struct pci_dev * pdev
Definition: igb.h:582
unsigned int flags
Definition: igb.h:538
static void igb_clear_interrupt_scheme(struct igb_adapter *adapter)
Definition: igb_main.c:855
static void igb_assign_vector(struct igb_q_vector *q_vector, int msix_vector)
Definition: igb_main.c:555
static void igb_free_all_tx_resources(struct igb_adapter *)
Definition: igb_main.c:4164
static int igb_setup_all_rx_resources(struct igb_adapter *)
Definition: igb_main.c:3698
static void igb_free_all_rx_resources(struct igb_adapter *)
Definition: igb_main.c:4266
struct igb_q_vector * q_vector[MAX_Q_VECTORS]
Definition: igb.h:607
static void igb_reset_sriov_capability(struct igb_adapter *adapter)
Definition: igb_main.c:949
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
static int igb_init_interrupt_scheme(struct igb_adapter *adapter, bool msix)
Definition: igb_main.c:1343
static int igb_request_msix(struct igb_adapter *adapter)
Definition: igb_main.c:707
static void igb_configure(struct igb_adapter *)
Definition: igb_main.c:1579
static int igb_setup_all_tx_resources(struct igb_adapter *)
Definition: igb_main.c:3535

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_request_msix ( struct igb_adapter adapter)
static

igb_request_msix - Initialize MSI-X interrupts

igb_request_msix allocates MSI-X vectors and requests interrupts from the kernel.

igb_main.c 파일의 707 번째 라인에서 정의되었습니다.

708 {
709  struct net_device *netdev = adapter->netdev;
710  struct e1000_hw *hw = &adapter->hw;
711  int i, err = 0, vector = 0, free_vector = 0;
712 
713  err = request_irq(adapter->msix_entries[vector].vector,
714  &igb_msix_other, 0, netdev->name, adapter);
715  if (err)
716  goto err_out;
717 
718  for (i = 0; i < adapter->num_q_vectors; i++) {
719  struct igb_q_vector *q_vector = adapter->q_vector[i];
720 
721  vector++;
722 
723  q_vector->itr_register = hw->hw_addr + E1000_EITR(vector);
724 
725  if (q_vector->rx.ring && q_vector->tx.ring)
726  sprintf(q_vector->name, "%s-TxRx-%u", netdev->name,
727  q_vector->rx.ring->queue_index);
728  else if (q_vector->tx.ring)
729  sprintf(q_vector->name, "%s-tx-%u", netdev->name,
730  q_vector->tx.ring->queue_index);
731  else if (q_vector->rx.ring)
732  sprintf(q_vector->name, "%s-rx-%u", netdev->name,
733  q_vector->rx.ring->queue_index);
734  else
735  sprintf(q_vector->name, "%s-unused", netdev->name);
736 
737  err = request_irq(adapter->msix_entries[vector].vector,
738  igb_msix_ring, 0, q_vector->name,
739  q_vector);
740  if (err)
741  goto err_free;
742  }
743 
744  igb_configure_msix(adapter);
745  return 0;
746 
747 err_free:
748  /* free already assigned IRQs */
749  free_irq(adapter->msix_entries[free_vector++].vector, adapter);
750 
751  vector--;
752  for (i = 0; i < vector; i++) {
753  free_irq(adapter->msix_entries[free_vector++].vector,
754  adapter->q_vector[i]);
755  }
756 err_out:
757  return err;
758 }
unsigned int num_q_vectors
Definition: igb.h:540
void __iomem * itr_register
Definition: igb.h:417
struct msix_entry * msix_entries
Definition: igb.h:541
struct e1000_hw hw
Definition: igb.h:594
int err
struct net_device * netdev
Definition: igb.h:535
u8 queue_index
Definition: igb.h:380
#define E1000_EITR(_n)
Definition: e1000_regs.h:66
static irqreturn_t igb_msix_ring(int irq, void *)
Definition: igb_main.c:6262
static irqreturn_t igb_msix_other(int irq, void *)
Definition: igb_main.c:6197
u8 __iomem * hw_addr
Definition: e1000_hw.h:758
struct igb_ring_container rx tx
Definition: igb.h:419
struct igb_q_vector * q_vector[MAX_Q_VECTORS]
Definition: igb.h:607
static void igb_configure_msix(struct igb_adapter *adapter)
Definition: igb_main.c:641
struct igb_ring * ring
Definition: igb.h:357
char name[IFNAMSIZ+9]
Definition: igb.h:426

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_reset ( struct igb_adapter adapter)

igb_main.c 파일의 1967 번째 라인에서 정의되었습니다.

1968 {
1969  struct pci_dev *pdev = adapter->pdev;
1970  struct e1000_hw *hw = &adapter->hw;
1971  struct e1000_mac_info *mac = &hw->mac;
1972  struct e1000_fc_info *fc = &hw->fc;
1973  u32 pba = 0, tx_space, min_tx_space, min_rx_space, hwm;
1974 
1975  /* Repartition Pba for greater than 9k mtu
1976  * To take effect CTRL.RST is required.
1977  */
1978  pba = E1000_PBA_32K;
1979 
1980  if ((adapter->max_frame_size > ETH_FRAME_LEN + ETH_FCS_LEN) &&
1981  (mac->type < e1000_82576)) {
1982  /* adjust PBA for jumbo frames */
1983  E1000_WRITE_REG(hw, E1000_PBA, pba);
1984 
1985  /* To maintain wire speed transmits, the Tx FIFO should be
1986  * large enough to accommodate two full transmit packets,
1987  * rounded up to the next 1KB and expressed in KB. Likewise,
1988  * the Rx FIFO should be large enough to accommodate at least
1989  * one full receive packet and is similarly rounded up and
1990  * expressed in KB.
1991  */
1992  pba = E1000_READ_REG(hw, E1000_PBA);
1993  /* upper 16 bits has Tx packet buffer allocation size in KB */
1994  tx_space = pba >> 16;
1995  /* lower 16 bits has Rx packet buffer allocation size in KB */
1996  pba &= 0xffff;
1997  /* the tx fifo also stores 16 bytes of information about the tx
1998  * but don't include ethernet FCS because hardware appends it
1999  */
2000  min_tx_space = (adapter->max_frame_size +
2001  sizeof(union e1000_adv_tx_desc) -
2002  ETH_FCS_LEN) * 2;
2003  min_tx_space = ALIGN(min_tx_space, 1024);
2004  min_tx_space >>= 10;
2005  /* software strips receive CRC, so leave room for it */
2006  min_rx_space = adapter->max_frame_size;
2007  min_rx_space = ALIGN(min_rx_space, 1024);
2008  min_rx_space >>= 10;
2009 
2010  /* If current Tx allocation is less than the min Tx FIFO size,
2011  * and the min Tx FIFO size is less than the current Rx FIFO
2012  * allocation, take space away from current Rx allocation
2013  */
2014  if (tx_space < min_tx_space &&
2015  ((min_tx_space - tx_space) < pba)) {
2016  pba = pba - (min_tx_space - tx_space);
2017 
2018  /* if short on rx space, rx wins and must trump tx
2019  * adjustment
2020  */
2021  if (pba < min_rx_space)
2022  pba = min_rx_space;
2023  }
2024  E1000_WRITE_REG(hw, E1000_PBA, pba);
2025  }
2026 
2027  /* flow control settings */
2028  /* The high water mark must be low enough to fit one full frame
2029  * (or the size used for early receive) above it in the Rx FIFO.
2030  * Set it to the lower of:
2031  * - 90% of the Rx FIFO size, or
2032  * - the full Rx FIFO size minus one full frame
2033  */
2034  hwm = min(((pba << 10) * 9 / 10),
2035  ((pba << 10) - 2 * adapter->max_frame_size));
2036 
2037  fc->high_water = hwm & 0xFFFFFFF0; /* 16-byte granularity */
2038  fc->low_water = fc->high_water - 16;
2039  fc->pause_time = 0xFFFF;
2040  fc->send_xon = 1;
2041  fc->current_mode = fc->requested_mode;
2042 
2043  /* disable receive for all VFs and wait one second */
2044  if (adapter->vfs_allocated_count) {
2045  int i;
2046 
2047  /*
2048  * Clear all flags except indication that the PF has set
2049  * the VF MAC addresses administratively
2050  */
2051  for (i = 0 ; i < adapter->vfs_allocated_count; i++)
2052  adapter->vf_data[i].flags &= IGB_VF_FLAG_PF_SET_MAC;
2053 
2054  /* ping all the active vfs to let them know we are going down */
2055  igb_ping_all_vfs(adapter);
2056 
2057  /* disable transmits and receives */
2058  E1000_WRITE_REG(hw, E1000_VFRE, 0);
2059  E1000_WRITE_REG(hw, E1000_VFTE, 0);
2060  }
2061 
2062  /* Allow time for pending master requests to run */
2063  e1000_reset_hw(hw);
2064  E1000_WRITE_REG(hw, E1000_WUC, 0);
2065 
2066  if (adapter->flags & IGB_FLAG_MEDIA_RESET) {
2068  igb_check_options(adapter);
2069  e1000_get_bus_info(hw);
2070  adapter->flags &= ~IGB_FLAG_MEDIA_RESET;
2071  }
2072  if (e1000_init_hw(hw))
2073  dev_err(pci_dev_to_dev(pdev), "Hardware Error\n");
2074 
2075  /*
2076  * Flow control settings reset on hardware reset, so guarantee flow
2077  * control is off when forcing speed.
2078  */
2079  if (!hw->mac.autoneg)
2080  e1000_force_mac_fc(hw);
2081 
2082  igb_init_avb(hw);
2083  igb_init_dmac(adapter, pba);
2084  /* Re-initialize the thermal sensor on i350 devices. */
2085  if (mac->type == e1000_i350 && hw->bus.func == 0) {
2086  /*
2087  * If present, re-initialize the external thermal sensor
2088  * interface.
2089  */
2090  if (adapter->ets)
2091  e1000_set_i2c_bb(hw);
2093  }
2094 
2095  /*Re-establish EEE setting */
2096  if (hw->phy.media_type == e1000_media_type_copper) {
2097  switch (mac->type) {
2098  case e1000_i350:
2099  case e1000_i210:
2100  case e1000_i211:
2101  e1000_set_eee_i350(hw, true, true);
2102  break;
2103  case e1000_i354:
2104  e1000_set_eee_i354(hw, true, true);
2105  break;
2106  default:
2107  break;
2108  }
2109  }
2110 
2111  if (!netif_running(adapter->netdev))
2112  igb_power_down_link(adapter);
2113 
2114  igb_update_mng_vlan(adapter);
2115 
2116  /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
2118 
2119 #ifdef HAVE_PTP_1588_CLOCK
2120  /* Re-enable PTP, where applicable. */
2121  igb_ptp_reset(adapter);
2122 #endif /* HAVE_PTP_1588_CLOCK */
2123 
2124  e1000_get_phy_info(hw);
2125 
2126  adapter->devrc++;
2127 }
enum e1000_fc_mode requested_mode
Definition: e1000_hw.h:707
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
s32 e1000_get_bus_info(struct e1000_hw *hw)
Definition: e1000_api.c:306
static void igb_power_down_link(struct igb_adapter *adapter)
Definition: igb_main.c:1634
#define E1000_VFRE
Definition: e1000_regs.h:490
#define E1000_WUC
Definition: e1000_regs.h:430
bool ets
Definition: igb.h:639
struct e1000_bus_info bus
Definition: e1000_hw.h:766
struct net_device * netdev
Definition: igb.h:535
#define IGB_VF_FLAG_PF_SET_MAC
Definition: igb.h:163
struct e1000_phy_info phy
Definition: e1000_hw.h:764
#define IGB_FLAG_MEDIA_RESET
Definition: igb.h:726
s32 e1000_init_thermal_sensor_thresh(struct e1000_hw *hw)
Definition: e1000_api.c:1153
struct pci_dev * pdev
Definition: igb.h:582
u32 max_frame_size
Definition: igb.h:579
unsigned int flags
Definition: igb.h:538
u16 pause_time
Definition: e1000_hw.h:702
enum e1000_fc_mode current_mode
Definition: e1000_hw.h:706
static void igb_ping_all_vfs(struct igb_adapter *)
Definition: igb_main.c:6420
s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device)
Definition: e1000_api.c:223
enum e1000_media_type media_type
Definition: e1000_hw.h:657
struct e1000_mac_info mac
Definition: e1000_hw.h:762
s32 e1000_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M)
Definition: e1000_82575.c:2918
void igb_check_options(struct igb_adapter *)
Definition: igb_param.c:324
enum e1000_mac_type type
Definition: e1000_hw.h:602
bool send_xon
Definition: e1000_hw.h:704
struct e1000_fc_info fc
Definition: e1000_hw.h:763
static void igb_update_mng_vlan(struct igb_adapter *adapter)
Definition: igb_main.c:1509
s32 e1000_set_eee_i354(struct e1000_hw *hw, bool adv1G, bool adv100M)
Definition: e1000_82575.c:2973
struct vf_data_storage * vf_data
Definition: igb.h:615
#define ETHERNET_IEEE_VLAN_TYPE
s32 e1000_init_hw(struct e1000_hw *hw)
Definition: e1000_api.c:438
#define E1000_VET
Definition: e1000_regs.h:53
u32 flags
Definition: igb.h:148
int devrc
Definition: igb.h:685
u32 high_water
Definition: e1000_hw.h:700
s32 e1000_reset_hw(struct e1000_hw *hw)
Definition: e1000_api.c:423
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
s32 e1000_force_mac_fc(struct e1000_hw *hw)
Definition: e1000_api.c:367
#define TRUE
Definition: maap_log.h:91
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
s32 e1000_get_phy_info(struct e1000_hw *hw)
Definition: e1000_api.c:857
static int igb_init_avb(struct e1000_hw *hw)
Definition: igb_main.c:10160
static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
Definition: igb_main.c:9969
u_int32_t u32
Definition: e1000_osdep.h:50
s32 e1000_set_i2c_bb(struct e1000_hw *hw)
Definition: e1000_82575.c:3137
#define E1000_VFTE
Definition: e1000_regs.h:491
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
#define E1000_PBA_32K
#define E1000_PBA
Definition: e1000_regs.h:84

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_reset_interrupt_capability ( struct igb_adapter adapter)
static

igb_main.c 파일의 811 번째 라인에서 정의되었습니다.

812 {
813  int v_idx = adapter->num_q_vectors;
814 
815  if (adapter->msix_entries) {
816  pci_disable_msix(adapter->pdev);
817  kfree(adapter->msix_entries);
818  adapter->msix_entries = NULL;
819  } else if (adapter->flags & IGB_FLAG_HAS_MSI) {
820  pci_disable_msi(adapter->pdev);
821  }
822 
823  while (v_idx--)
824  igb_reset_q_vector(adapter, v_idx);
825 }
unsigned int num_q_vectors
Definition: igb.h:540
struct msix_entry * msix_entries
Definition: igb.h:541
#define pci_disable_msi(a)
Definition: kcompat.h:108
#define IGB_FLAG_HAS_MSI
Definition: igb.h:712
struct pci_dev * pdev
Definition: igb.h:582
unsigned int flags
Definition: igb.h:538
#define pci_disable_msix(a)
Definition: kcompat.h:112
static void igb_reset_q_vector(struct igb_adapter *adapter, int v_idx)
Definition: igb_main.c:791
#define NULL
Null pointer value.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_reset_q_vector ( struct igb_adapter adapter,
int  v_idx 
)
static

igb_reset_q_vector - Reset config for interrupt vector : board private structure to initialize : Index of vector to be reset

If NAPI is enabled it will delete any references to the NAPI struct. This is preparation for igb_free_q_vector.

igb_main.c 파일의 791 번째 라인에서 정의되었습니다.

792 {
793  struct igb_q_vector *q_vector = adapter->q_vector[v_idx];
794 
795  /* if we're coming from igb_set_interrupt_capability, the vectors are
796  * not yet allocated
797  */
798  if (!q_vector)
799  return;
800 
801  if (q_vector->tx.ring)
802  adapter->tx_ring[q_vector->tx.ring->queue_index] = NULL;
803 
804  if (q_vector->rx.ring)
805  adapter->rx_ring[q_vector->rx.ring->queue_index] = NULL;
806 
807  netif_napi_del(&q_vector->napi);
808 
809 }
u8 queue_index
Definition: igb.h:380
struct igb_ring * rx_ring[IGB_MAX_RX_QUEUES]
Definition: igb.h:552
struct igb_ring_container rx tx
Definition: igb.h:419
struct igb_q_vector * q_vector[MAX_Q_VECTORS]
Definition: igb.h:607
struct igb_ring * tx_ring[IGB_MAX_TX_QUEUES]
Definition: igb.h:548
struct napi_struct napi
Definition: igb.h:421
struct igb_ring * ring
Definition: igb.h:357
#define NULL
Null pointer value.

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_reset_sriov_capability ( struct igb_adapter adapter)
static

igb_reset_sriov_capability - disable SR-IOV if enabled

Attempt to disable single root IO virtualization capabilites present in the kernel.

igb_main.c 파일의 949 번째 라인에서 정의되었습니다.

950 {
951  struct pci_dev *pdev = adapter->pdev;
952  struct e1000_hw *hw = &adapter->hw;
953 
954  /* reclaim resources allocated to VFs */
955  if (adapter->vf_data) {
956  if (!pci_vfs_assigned(pdev)) {
957  /*
958  * disable iov and allow time for transactions to
959  * clear
960  */
961  pci_disable_sriov(pdev);
962  msleep(500);
963 
964  dev_info(pci_dev_to_dev(pdev), "IOV Disabled\n");
965  } else {
966  dev_info(pci_dev_to_dev(pdev),
967  "IOV Not Disabled\n VF(s) are assigned to guests!\n");
968  }
969  /* Disable Malicious Driver Detection */
970  igb_disable_mdd(adapter);
971 
972  /* free vf data storage */
973  kfree(adapter->vf_data);
974  adapter->vf_data = NULL;
975 
976  /* switch rings back to PF ownership */
979  E1000_WRITE_FLUSH(hw);
980  msleep(100);
981  }
982 
983  adapter->vfs_allocated_count = 0;
984 }
struct e1000_hw hw
Definition: igb.h:594
#define E1000_IOVCTL
Definition: e1000_82575.h:446
unsigned int vfs_allocated_count
Definition: igb.h:621
#define E1000_IOVCTL_REUSE_VFQ
Definition: e1000_82575.h:447
struct pci_dev * pdev
Definition: igb.h:582
struct vf_data_storage * vf_data
Definition: igb.h:615
#define E1000_WRITE_FLUSH(a)
Definition: e1000_osdep.h:127
static void igb_disable_mdd(struct igb_adapter *adapter)
Definition: igb_main.c:908
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define NULL
Null pointer value.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_reset_task ( struct work_struct *  work)
static

igb_main.c 파일의 5818 번째 라인에서 정의되었습니다.

5819 {
5820  struct igb_adapter *adapter;
5821 
5822  adapter = container_of(work, struct igb_adapter, reset_task);
5823 
5824  igb_reinit_locked(adapter);
5825 }
struct work_struct reset_task
Definition: igb.h:569
void igb_reinit_locked(struct igb_adapter *adapter)
Definition: igb_main.c:1935

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_restore_vf_multicasts ( struct igb_adapter adapter)
static

igb_main.c 파일의 6547 번째 라인에서 정의되었습니다.

6548 {
6549  struct e1000_hw *hw = &adapter->hw;
6550  struct vf_data_storage *vf_data;
6551  int i, j;
6552 
6553  for (i = 0; i < adapter->vfs_allocated_count; i++) {
6554  u32 vmolr = E1000_READ_REG(hw, E1000_VMOLR(i));
6555 
6556  vmolr &= ~(E1000_VMOLR_ROMPE | E1000_VMOLR_MPME);
6557 
6558  vf_data = &adapter->vf_data[i];
6559 
6560  if ((vf_data->num_vf_mc_hashes > 30) ||
6561  (vf_data->flags & IGB_VF_FLAG_MULTI_PROMISC)) {
6562  vmolr |= E1000_VMOLR_MPME;
6563  } else if (vf_data->num_vf_mc_hashes) {
6564  vmolr |= E1000_VMOLR_ROMPE;
6565  for (j = 0; j < vf_data->num_vf_mc_hashes; j++)
6566  igb_mta_set(adapter, vf_data->vf_mc_hashes[j]);
6567  }
6568  E1000_WRITE_REG(hw, E1000_VMOLR(i), vmolr);
6569  }
6570 }
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
void igb_mta_set(struct igb_adapter *adapter, u32 hash_value)
Definition: igb_main.c:6444
#define E1000_VMOLR_MPME
Definition: e1000_82575.h:421
#define E1000_VMOLR_ROMPE
Definition: e1000_82575.h:418
u16 vf_mc_hashes[IGB_MAX_VF_MC_ENTRIES]
Definition: igb.h:142
struct vf_data_storage * vf_data
Definition: igb.h:615
u16 num_vf_mc_hashes
Definition: igb.h:143
u32 flags
Definition: igb.h:148
#define E1000_VMOLR(_n)
Definition: e1000_regs.h:512
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
#define IGB_VF_FLAG_MULTI_PROMISC
Definition: igb.h:162

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_restore_vlan ( struct igb_adapter adapter)
static

igb_main.c 파일의 9125 번째 라인에서 정의되었습니다.

9126 {
9127 #ifdef HAVE_VLAN_RX_REGISTER
9128  igb_vlan_mode(adapter->netdev, adapter->vlgrp);
9129 
9130  if (adapter->vlgrp) {
9131  u16 vid;
9132 
9133  for (vid = 0; vid < VLAN_N_VID; vid++) {
9134  if (!vlan_group_get_device(adapter->vlgrp, vid))
9135  continue;
9136 #ifdef NETIF_F_HW_VLAN_CTAG_RX
9137  igb_vlan_rx_add_vid(adapter->netdev,
9138  htons(ETH_P_8021Q), vid);
9139 #else
9140  igb_vlan_rx_add_vid(adapter->netdev, vid);
9141 #endif
9142  }
9143  }
9144 #else
9145  u16 vid;
9146 
9147  igb_vlan_mode(adapter->netdev, adapter->netdev->features);
9148 
9149  for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID)
9150 #ifdef NETIF_F_HW_VLAN_CTAG_RX
9151  igb_vlan_rx_add_vid(adapter->netdev,
9152  htons(ETH_P_8021Q), vid);
9153 #else
9154  igb_vlan_rx_add_vid(adapter->netdev, vid);
9155 #endif
9156 #endif
9157 }
struct net_device * netdev
Definition: igb.h:535
u_int16_t u16
Definition: e1000_osdep.h:51
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]
Definition: igb.h:533
void igb_vlan_mode(struct net_device *netdev, u32 features)
Definition: igb_main.c:8962
static int igb_vlan_rx_add_vid(struct net_device *, u16)
Definition: igb_main.c:9046
#define ETH_P_8021Q
Definition: kcompat.h:148

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_reuse_rx_page ( struct igb_ring rx_ring,
struct igb_rx_buffer old_buff 
)
static

igb_reuse_rx_page - page flip buffer and store it back on the ring : rx descriptor ring to store buffers on : donor buffer to have page reused

Synchronizes page for reuse by the adapter

igb_main.c 파일의 7500 번째 라인에서 정의되었습니다.

7502 {
7503  struct igb_rx_buffer *new_buff;
7504  u16 nta = rx_ring->next_to_alloc;
7505 
7506  new_buff = &rx_ring->rx_buffer_info[nta];
7507 
7508  /* update, and store next to alloc */
7509  nta++;
7510  rx_ring->next_to_alloc = (nta < rx_ring->count) ? nta : 0;
7511 
7512  /* transfer page from old buffer to new buffer */
7513  *new_buff = *old_buff;
7514 
7515  /* sync the buffer for use by the device */
7516  dma_sync_single_range_for_device(rx_ring->dev, old_buff->dma,
7517  old_buff->page_offset,
7518  IGB_RX_BUFSZ,
7519  DMA_FROM_DEVICE);
7520 }
u16 count
Definition: igb.h:379
struct device * dev
Definition: igb.h:368
struct igb_rx_buffer * rx_buffer_info
Definition: igb.h:371
u_int16_t u16
Definition: e1000_osdep.h:51
#define IGB_RX_BUFSZ
Definition: igb.h:198
u16 next_to_alloc
Definition: igb.h:386
dma_addr_t dma
Definition: igb.h:321
u32 page_offset
Definition: igb.h:326

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_ring_irq_enable ( struct igb_q_vector q_vector)

igb_main.c 파일의 7210 번째 라인에서 정의되었습니다.

7211 {
7212  struct igb_adapter *adapter = q_vector->adapter;
7213  struct e1000_hw *hw = &adapter->hw;
7214 
7215  if ((q_vector->rx.ring && (adapter->rx_itr_setting & 3)) ||
7216  (!q_vector->rx.ring && (adapter->tx_itr_setting & 3))) {
7217  if ((adapter->num_q_vectors == 1) && !adapter->vf_data)
7218  igb_set_itr(q_vector);
7219  else
7220  igb_update_ring_itr(q_vector);
7221  }
7222 
7223  if (!test_bit(__IGB_DOWN, &adapter->state)) {
7224  if (adapter->msix_entries)
7225  E1000_WRITE_REG(hw, E1000_EIMS, q_vector->eims_value);
7226  else
7227  igb_irq_enable(adapter);
7228  }
7229 }
unsigned int num_q_vectors
Definition: igb.h:540
struct msix_entry * msix_entries
Definition: igb.h:541
struct e1000_hw hw
Definition: igb.h:594
struct igb_adapter * adapter
Definition: igb.h:411
u32 eims_value
Definition: igb.h:413
unsigned long state
Definition: igb.h:537
struct vf_data_storage * vf_data
Definition: igb.h:615
static void igb_update_ring_itr(struct igb_q_vector *q_vector)
Definition: igb_main.c:5071
u32 rx_itr_setting
Definition: igb.h:566
u32 tx_itr_setting
Definition: igb.h:567
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_EIMS
Definition: e1000_regs.h:68
static void igb_irq_enable(struct igb_adapter *adapter)
Definition: igb_main.c:1478
static void igb_set_itr(struct igb_q_vector *q_vector)
Definition: igb_main.c:5201

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_rlpml_set ( struct igb_adapter adapter)
static

igb_rlpml_set - set maximum receive packet size : board private structure

Configure maximum receivable packet size.

igb_main.c 파일의 3937 번째 라인에서 정의되었습니다.

3938 {
3939  u32 max_frame_size = adapter->max_frame_size;
3940  struct e1000_hw *hw = &adapter->hw;
3941  u16 pf_id = adapter->vfs_allocated_count;
3942 
3943  if (adapter->vmdq_pools && hw->mac.type != e1000_82575) {
3944  int i;
3945 
3946  for (i = 0; i < adapter->vmdq_pools; i++)
3947  igb_set_vf_rlpml(adapter, max_frame_size, pf_id + i);
3948  /*
3949  * If we're in VMDQ or SR-IOV mode, then set global RLPML
3950  * to our max jumbo frame size, in case we need to enable
3951  * jumbo frames on one of the rings later.
3952  * This will not pass over-length frames into the default
3953  * queue because it's gated by the VMOLR.RLPML.
3954  */
3955  max_frame_size = MAX_JUMBO_FRAME_SIZE;
3956  }
3957  /* Set VF RLPML for the PF device. */
3958  if (adapter->vfs_allocated_count)
3959  igb_set_vf_rlpml(adapter, max_frame_size, pf_id);
3960 
3961  E1000_WRITE_REG(hw, E1000_RLPML, max_frame_size);
3962 }
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
u32 max_frame_size
Definition: igb.h:579
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
u_int16_t u16
Definition: e1000_osdep.h:51
u32 vmdq_pools
Definition: igb.h:627
static int igb_set_vf_rlpml(struct igb_adapter *adapter, int size, int vfn)
Definition: igb_main.c:3900
#define MAX_JUMBO_FRAME_SIZE
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_RLPML
Definition: e1000_regs.h:419
u_int32_t u32
Definition: e1000_osdep.h:50

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_rx_checksum ( struct igb_ring ring,
union e1000_adv_rx_desc rx_desc,
struct sk_buff *  skb 
)
inlinestatic

igb_main.c 파일의 7670 번째 라인에서 정의되었습니다.

7673 {
7674  skb_checksum_none_assert(skb);
7675 
7676  /* Ignore Checksum bit is set */
7677  if (igb_test_staterr(rx_desc, E1000_RXD_STAT_IXSM))
7678  return;
7679 
7680  /* Rx checksum disabled via ethtool */
7681  if (!(netdev_ring(ring)->features & NETIF_F_RXCSUM))
7682  return;
7683 
7684  /* TCP/UDP checksum error bit is set */
7685  if (igb_test_staterr(rx_desc,
7688  /*
7689  * work around errata with sctp packets where the TCPE aka
7690  * L4E bit is set incorrectly on 64 byte (60 byte w/o crc)
7691  * packets, (aka let the stack check the crc32c)
7692  */
7693  if (!((skb->len == 60) &&
7694  test_bit(IGB_RING_FLAG_RX_SCTP_CSUM, &ring->flags)))
7695  ring->rx_stats.csum_err++;
7696 
7697  /* let the stack verify checksum errors */
7698  return;
7699  }
7700  /* It must be a TCP or UDP packet with a valid checksum */
7701  if (igb_test_staterr(rx_desc, E1000_RXD_STAT_TCPCS |
7703  skb->ip_summed = CHECKSUM_UNNECESSARY;
7704 }
#define E1000_RXD_STAT_UDPCS
#define netdev_ring(ring)
Definition: igb.h:469
#define E1000_RXDEXT_STATERR_IPE
#define E1000_RXD_STAT_IXSM
static __le32 igb_test_staterr(union e1000_adv_rx_desc *rx_desc, const u32 stat_err_bits)
Definition: igb.h:474
#define E1000_RXD_STAT_TCPCS
unsigned long flags
Definition: igb.h:374
struct igb_rx_queue_stats rx_stats
Definition: igb.h:395
#define E1000_RXDEXT_STATERR_TCPE
const char features[]
Definition: feature_tests.c:2

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static u16 igb_select_queue ( struct net_device *  dev,
struct sk_buff *  skb,
void *  accel_priv,
select_queue_fallback_t  fallback 
)
static

igb_main.c 파일의 5760 번째 라인에서 정의되었습니다.

5765 {
5766  /* remap normal LAN to best effort queue[3] */
5767  return 3;
5768 }
static int igb_set_features ( struct net_device *  netdev,
netdev_features_t  features 
)
static

igb_main.c 파일의 2152 번째 라인에서 정의되었습니다.

2154 {
2155  u32 changed = netdev->features ^ features;
2156 
2157 #ifdef NETIF_F_HW_VLAN_CTAG_RX
2158  if (changed & NETIF_F_HW_VLAN_CTAG_RX)
2159 #else
2160  if (changed & NETIF_F_HW_VLAN_RX)
2161 #endif
2162  igb_vlan_mode(netdev, features);
2163 
2164  return 0;
2165 }
void igb_vlan_mode(struct net_device *netdev, u32 features)
Definition: igb_main.c:8962
u_int32_t u32
Definition: e1000_osdep.h:50
const char features[]
Definition: feature_tests.c:2

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static void igb_set_fw_version ( struct igb_adapter adapter)
static

igb_set_fw_version - Configure version string for ethtool : adapter struct

igb_main.c 파일의 2508 번째 라인에서 정의되었습니다.

2509 {
2510  struct e1000_hw *hw = &adapter->hw;
2511  struct e1000_fw_version fw;
2512 
2513  e1000_get_fw_version(hw, &fw);
2514 
2515  switch (hw->mac.type) {
2516  case e1000_i210:
2517  case e1000_i211:
2518  if (!(e1000_get_flash_presence_i210(hw))) {
2519  snprintf(adapter->fw_version,
2520  sizeof(adapter->fw_version),
2521  "%2d.%2d-%d",
2522  fw.invm_major, fw.invm_minor, fw.invm_img_type);
2523  break;
2524  }
2525  /* fall through */
2526  default:
2527  /* if option rom is valid, display its version too*/
2528  if (fw.or_valid) {
2529  snprintf(adapter->fw_version,
2530  sizeof(adapter->fw_version),
2531  "%d.%d, 0x%08x, %d.%d.%d",
2532  fw.eep_major, fw.eep_minor, fw.etrack_id,
2533  fw.or_major, fw.or_build, fw.or_patch);
2534  /* no option rom */
2535  } else {
2536  if (fw.etrack_id != 0X0000) {
2537  snprintf(adapter->fw_version,
2538  sizeof(adapter->fw_version),
2539  "%d.%d, 0x%08x",
2540  fw.eep_major, fw.eep_minor, fw.etrack_id);
2541  } else {
2542  snprintf(adapter->fw_version,
2543  sizeof(adapter->fw_version),
2544  "%d.%d.%d",
2545  fw.eep_major, fw.eep_minor, fw.eep_build);
2546  }
2547  }
2548  break;
2549  }
2550 }
struct e1000_hw hw
Definition: igb.h:594
char fw_version[32]
Definition: igb.h:628
bool e1000_get_flash_presence_i210(struct e1000_hw *hw)
Definition: e1000_i210.c:685
void e1000_get_fw_version(struct e1000_hw *hw, struct e1000_fw_version *fw_vers)
Definition: e1000_nvm.c:870
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_set_interrupt_capability ( struct igb_adapter adapter,
bool  msix 
)
static

igb_set_interrupt_capability - set MSI or MSI-X if supported

Attempt to configure interrupts using the best available capabilities of the hardware and kernel.

igb_main.c 파일의 1057 번째 라인에서 정의되었습니다.

1058 {
1059  struct pci_dev *pdev = adapter->pdev;
1060  int err;
1061  int numvecs, i;
1062 
1063  if (!msix)
1064  adapter->int_mode = IGB_INT_MODE_MSI;
1065 
1066  /* Number of supported queues. */
1067  adapter->num_rx_queues = adapter->rss_queues;
1068 
1069  if (adapter->vmdq_pools > 1)
1070  adapter->num_rx_queues += adapter->vmdq_pools - 1;
1071 
1072 #ifdef HAVE_TX_MQ
1073  if (adapter->vmdq_pools)
1074  adapter->num_tx_queues = adapter->vmdq_pools;
1075  else
1076  adapter->num_tx_queues = adapter->num_rx_queues;
1077 #else
1078  adapter->num_tx_queues = max_t(u32, 1, adapter->vmdq_pools);
1079 #endif
1080 
1081  switch (adapter->int_mode) {
1082  case IGB_INT_MODE_MSIX:
1083  /* start with one vector for every Tx/Rx queue */
1084  numvecs = max_t(int, adapter->num_tx_queues,
1085  adapter->num_rx_queues);
1086 
1087  /* if tx handler is separate make it 1 for every queue */
1088  if (!(adapter->flags & IGB_FLAG_QUEUE_PAIRS))
1089  numvecs = adapter->num_tx_queues +
1090  adapter->num_rx_queues;
1091 
1092  /* store the number of vectors reserved for queues */
1093  adapter->num_q_vectors = numvecs;
1094 
1095  /* add 1 vector for link status interrupts */
1096  numvecs++;
1097  adapter->msix_entries = kcalloc(numvecs,
1098  sizeof(struct msix_entry),
1099  GFP_KERNEL);
1100  if (adapter->msix_entries) {
1101  for (i = 0; i < numvecs; i++)
1102  adapter->msix_entries[i].entry = i;
1103 
1104 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
1105  err = pci_enable_msix_exact(pdev,
1106  adapter->msix_entries, numvecs);
1107 #else
1108  err = pci_enable_msix(pdev,
1109  adapter->msix_entries, numvecs);
1110 #endif
1111  if (err == 0)
1112  break;
1113  }
1114  /* MSI-X failed, so fall through and try MSI */
1115  dev_warn(pci_dev_to_dev(pdev),
1116  "Failed to initialize MSI-X interrupts. Falling back to MSI interrupts.\n");
1118  case IGB_INT_MODE_MSI:
1119  if (!pci_enable_msi(pdev))
1120  adapter->flags |= IGB_FLAG_HAS_MSI;
1121  else
1122  dev_warn(pci_dev_to_dev(pdev),
1123  "Failed to initialize MSI interrupts. Falling back to legacy interrupts.\n");
1124  /* Fall through */
1125  case IGB_INT_MODE_LEGACY:
1126  /* disable advanced features and set number of queues to 1 */
1127  igb_reset_sriov_capability(adapter);
1128  adapter->vmdq_pools = 0;
1129  adapter->rss_queues = 1;
1130  adapter->flags |= IGB_FLAG_QUEUE_PAIRS;
1131  adapter->num_rx_queues = 1;
1132  adapter->num_tx_queues = 1;
1133  adapter->num_q_vectors = 1;
1134  /* Don't do anything; this is system default */
1135  break;
1136  }
1137 }
unsigned int num_q_vectors
Definition: igb.h:540
struct msix_entry * msix_entries
Definition: igb.h:541
int err
static void igb_reset_interrupt_capability(struct igb_adapter *adapter)
Definition: igb_main.c:811
#define pci_enable_msix(a, b, c)
Definition: kcompat.h:110
#define IGB_FLAG_HAS_MSI
Definition: igb.h:712
struct pci_dev * pdev
Definition: igb.h:582
#define pci_enable_msi(a)
Definition: kcompat.h:106
unsigned int flags
Definition: igb.h:538
#define IGB_INT_MODE_MSIX
Definition: igb.h:107
int num_tx_queues
Definition: igb.h:547
int num_rx_queues
Definition: igb.h:551
u32 vmdq_pools
Definition: igb.h:627
u32 rss_queues
Definition: igb.h:625
int int_mode
Definition: igb.h:624
#define IGB_INT_MODE_LEGACY
Definition: igb.h:105
static void igb_reset_sriov_capability(struct igb_adapter *adapter)
Definition: igb_main.c:949
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
u_int32_t u32
Definition: e1000_osdep.h:50
#define IGB_INT_MODE_MSI
Definition: igb.h:106
#define IGB_FLAG_QUEUE_PAIRS
Definition: igb.h:716

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_set_itr ( struct igb_q_vector q_vector)
static

igb_main.c 파일의 5201 번째 라인에서 정의되었습니다.

5202 {
5203  struct igb_adapter *adapter = q_vector->adapter;
5204  u32 new_itr = q_vector->itr_val;
5205  u8 current_itr = 0;
5206 
5207  /* for non-gigabit speeds, just fix the interrupt rate at 4000 */
5208  switch (adapter->link_speed) {
5209  case SPEED_10:
5210  case SPEED_100:
5211  current_itr = 0;
5212  new_itr = IGB_4K_ITR;
5213  goto set_itr_now;
5214  default:
5215  break;
5216  }
5217 
5218  igb_update_itr(q_vector, &q_vector->tx);
5219  igb_update_itr(q_vector, &q_vector->rx);
5220 
5221  current_itr = max(q_vector->rx.itr, q_vector->tx.itr);
5222 
5223  /* conservative mode (itr 3) eliminates the lowest_latency setting */
5224  if (current_itr == lowest_latency &&
5225  ((q_vector->rx.ring && adapter->rx_itr_setting == 3) ||
5226  (!q_vector->rx.ring && adapter->tx_itr_setting == 3)))
5227  current_itr = low_latency;
5228 
5229  switch (current_itr) {
5230  /* counts and packets in update_itr are dependent on these numbers */
5231  case lowest_latency:
5232  new_itr = IGB_70K_ITR; /* 70,000 ints/sec */
5233  break;
5234  case low_latency:
5235  new_itr = IGB_20K_ITR; /* 20,000 ints/sec */
5236  break;
5237  case bulk_latency:
5238  new_itr = IGB_4K_ITR; /* 4,000 ints/sec */
5239  break;
5240  default:
5241  break;
5242  }
5243 
5244 set_itr_now:
5245  if (new_itr != q_vector->itr_val) {
5246  /* this attempts to bias the interrupt rate towards Bulk
5247  * by adding intermediate steps when interrupt rate is
5248  * increasing
5249  */
5250  new_itr = new_itr > q_vector->itr_val ?
5251  max((new_itr * q_vector->itr_val) /
5252  (new_itr + (q_vector->itr_val >> 2)),
5253  new_itr) : new_itr;
5254  /* Don't write the value here; it resets the adapter's
5255  * internal timer, and causes us to delay far longer than
5256  * we should between interrupts. Instead, we write the ITR
5257  * value at the beginning of the next interrupt so the timing
5258  * ends up being correct.
5259  */
5260  q_vector->itr_val = new_itr;
5261  q_vector->set_itr = 1;
5262  }
5263 }
#define IGB_4K_ITR
Definition: igb.h:100
u8 set_itr
Definition: igb.h:416
struct igb_adapter * adapter
Definition: igb.h:411
#define IGB_20K_ITR
Definition: igb.h:101
#define IGB_70K_ITR
Definition: igb.h:102
static void igb_update_itr(struct igb_q_vector *q_vector, struct igb_ring_container *ring_container)
Definition: igb_main.c:5149
struct igb_ring_container rx tx
Definition: igb.h:419
u_int8_t u8
Definition: e1000_osdep.h:52
u32 rx_itr_setting
Definition: igb.h:566
u16 itr_val
Definition: igb.h:415
u32 tx_itr_setting
Definition: igb.h:567
#define SPEED_100
u16 link_speed
Definition: igb.h:561
u_int32_t u32
Definition: e1000_osdep.h:50
#define SPEED_10

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_set_mac ( struct net_device *  netdev,
void *  p 
)
static

igb_set_mac - Change the Ethernet Address of the NIC : network interface device structure : pointer to an address structure

Returns 0 on success, negative on failure

igb_main.c 파일의 4353 번째 라인에서 정의되었습니다.

4354 {
4355  struct igb_adapter *adapter = netdev_priv(netdev);
4356  struct e1000_hw *hw = &adapter->hw;
4357  struct sockaddr *addr = p;
4358 
4359  if (!is_valid_ether_addr(addr->sa_data))
4360  return -EADDRNOTAVAIL;
4361 
4362  memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
4363  memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len);
4364 
4365  /* set the correct pool for the new PF MAC address in entry 0 */
4366  igb_rar_set_qsel(adapter, hw->mac.addr, 0,
4367  adapter->vfs_allocated_count);
4368 
4369  return 0;
4370 }
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
static void igb_rar_set_qsel(struct igb_adapter *, u8 *, u32, u8)
Definition: igb_main.c:4478
struct net_device * netdev
Definition: igb.h:535
u8 addr[ETH_ADDR_LEN]
Definition: e1000_hw.h:599
struct e1000_mac_info mac
Definition: e1000_hw.h:762

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_set_rx_mode ( struct net_device *  netdev)
static

igb_set_rx_mode - Secondary Unicast, Multicast and Promiscuous mode set : network interface device structure

The set_rx_mode entry point is called whenever the unicast or multicast address lists or the network interface flags are updated. This routine is responsible for configuring the hardware for proper unicast, multicast, promiscuous mode, and all-multi behavior.

igb_main.c 파일의 4567 번째 라인에서 정의되었습니다.

4568 {
4569  struct igb_adapter *adapter = netdev_priv(netdev);
4570  struct e1000_hw *hw = &adapter->hw;
4571  unsigned int vfn = adapter->vfs_allocated_count;
4572  u32 rctl, vmolr = 0;
4573  int count;
4574 
4575  /* Check for Promiscuous and All Multicast modes */
4576  rctl = E1000_READ_REG(hw, E1000_RCTL);
4577 
4578  /* clear the effected bits */
4580 
4581  if (netdev->flags & IFF_PROMISC) {
4582  rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE);
4583  vmolr |= (E1000_VMOLR_ROPE | E1000_VMOLR_MPME);
4584  /* retain VLAN HW filtering if in VT mode */
4585  if (adapter->vfs_allocated_count || adapter->vmdq_pools)
4586  rctl |= E1000_RCTL_VFE;
4587  } else {
4588  if (netdev->flags & IFF_ALLMULTI) {
4589  rctl |= E1000_RCTL_MPE;
4590  vmolr |= E1000_VMOLR_MPME;
4591  } else {
4592  /*
4593  * Write addresses to the MTA, if the attempt fails
4594  * then we should just turn on promiscuous mode so
4595  * that we can at least receive multicast traffic
4596  */
4597  count = igb_write_mc_addr_list(netdev);
4598  if (count < 0) {
4599  rctl |= E1000_RCTL_MPE;
4600  vmolr |= E1000_VMOLR_MPME;
4601  } else if (count) {
4602  vmolr |= E1000_VMOLR_ROMPE;
4603  }
4604  }
4605 #ifdef HAVE_SET_RX_MODE
4606  /*
4607  * Write addresses to available RAR registers, if there is not
4608  * sufficient space to store all the addresses then enable
4609  * unicast promiscuous mode
4610  */
4611  count = igb_write_uc_addr_list(netdev);
4612  if (count < 0) {
4613  rctl |= E1000_RCTL_UPE;
4614  vmolr |= E1000_VMOLR_ROPE;
4615  }
4616 #endif /* HAVE_SET_RX_MODE */
4617  /* AVB specific */
4618  /* rctl |= E1000_RCTL_VFE; Disable VLAN filtering*/
4619  }
4620  E1000_WRITE_REG(hw, E1000_RCTL, rctl);
4621 
4622  /*
4623  * In order to support SR-IOV and eventually VMDq it is necessary to set
4624  * the VMOLR to enable the appropriate modes. Without this workaround
4625  * we will have issues with VLAN tag stripping not being done for frames
4626  * that are only arriving because we are the default pool
4627  */
4628  if (hw->mac.type < e1000_82576)
4629  return;
4630 
4631  vmolr |= E1000_READ_REG(hw, E1000_VMOLR(vfn)) &
4633  E1000_WRITE_REG(hw, E1000_VMOLR(vfn), vmolr);
4634  igb_restore_vf_multicasts(adapter);
4635 }
static void igb_restore_vf_multicasts(struct igb_adapter *adapter)
Definition: igb_main.c:6547
#define E1000_VMOLR_ROPE
Definition: e1000_82575.h:419
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
int igb_write_mc_addr_list(struct net_device *netdev)
Definition: igb_main.c:4381
#define E1000_RCTL_VFE
#define E1000_RCTL
Definition: e1000_regs.h:61
struct net_device * netdev
Definition: igb.h:535
static int igb_write_uc_addr_list(struct net_device *netdev)
Definition: igb_main.c:4515
#define E1000_VMOLR_MPME
Definition: e1000_82575.h:421
#define E1000_VMOLR_ROMPE
Definition: e1000_82575.h:418
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
u32 vmdq_pools
Definition: igb.h:627
#define E1000_RCTL_MPE
#define E1000_VMOLR(_n)
Definition: e1000_regs.h:512
#define E1000_RCTL_UPE
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

int igb_set_spd_dplx ( struct igb_adapter adapter,
u16  spddplx 
)

igb_main.c 파일의 9159 번째 라인에서 정의되었습니다.

9160 {
9161  struct pci_dev *pdev = adapter->pdev;
9162  struct e1000_mac_info *mac = &adapter->hw.mac;
9163 
9164  mac->autoneg = 0;
9165 
9166  /* SerDes device's does not support 10Mbps Full/duplex
9167  * and 100Mbps Half duplex
9168  */
9170  switch (spddplx) {
9171  case SPEED_10 + DUPLEX_HALF:
9172  case SPEED_10 + DUPLEX_FULL:
9173  case SPEED_100 + DUPLEX_HALF:
9174  dev_err(pci_dev_to_dev(pdev),
9175  "Unsupported Speed/Duplex configuration\n");
9176  return -EINVAL;
9177  default:
9178  break;
9179  }
9180  }
9181 
9182  switch (spddplx) {
9183  case SPEED_10 + DUPLEX_HALF:
9185  break;
9186  case SPEED_10 + DUPLEX_FULL:
9188  break;
9189  case SPEED_100 + DUPLEX_HALF:
9191  break;
9192  case SPEED_100 + DUPLEX_FULL:
9194  break;
9195  case SPEED_1000 + DUPLEX_FULL:
9196  mac->autoneg = 1;
9198  break;
9199  case SPEED_1000 + DUPLEX_HALF: /* not supported */
9200  default:
9201  dev_err(pci_dev_to_dev(pdev), "Unsupported Speed/Duplex configuration\n");
9202  return -EINVAL;
9203  }
9204 
9205  /* clear MDI, MDI(-X) override is only allowed when autoneg enabled */
9206  adapter->hw.phy.mdix = AUTO_ALL_MODES;
9207 
9208  return 0;
9209 }
struct e1000_hw hw
Definition: igb.h:594
#define ADVERTISE_100_HALF
u8 forced_speed_duplex
Definition: e1000_hw.h:625
struct e1000_phy_info phy
Definition: e1000_hw.h:764
#define ADVERTISE_10_FULL
struct pci_dev * pdev
Definition: igb.h:582
enum e1000_media_type media_type
Definition: e1000_hw.h:657
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define ADVERTISE_100_FULL
#define ADVERTISE_10_HALF
#define SPEED_1000
#define AUTO_ALL_MODES
Definition: igb.h:215
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
#define SPEED_100
u16 autoneg_advertised
Definition: e1000_hw.h:659
#define SPEED_10
#define ADVERTISE_1000_FULL

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static void igb_set_sriov_capability ( struct igb_adapter adapter)
static

igb_set_sriov_capability - setup SR-IOV if supported

Attempt to enable single root IO virtualization capabilites present in the kernel.

igb_main.c 파일의 992 번째 라인에서 정의되었습니다.

993 {
994  struct pci_dev *pdev = adapter->pdev;
995  int old_vfs = 0;
996  int i;
997 
998  old_vfs = pci_num_vf(pdev);
999  if (old_vfs) {
1000  dev_info(pci_dev_to_dev(pdev),
1001  "%d pre-allocated VFs found - override max_vfs setting of %d\n",
1002  old_vfs, adapter->vfs_allocated_count);
1003  adapter->vfs_allocated_count = old_vfs;
1004  }
1005  /* no VFs requested, do nothing */
1006  if (!adapter->vfs_allocated_count)
1007  return;
1008 
1009  /* allocate vf data storage */
1010  adapter->vf_data = kcalloc(adapter->vfs_allocated_count,
1011  sizeof(struct vf_data_storage),
1012  GFP_KERNEL);
1013 
1014  if (adapter->vf_data) {
1015  if (!old_vfs) {
1016  if (pci_enable_sriov(pdev,
1017  adapter->vfs_allocated_count))
1018  goto err_out;
1019  }
1020  for (i = 0; i < adapter->vfs_allocated_count; i++)
1021  igb_vf_configure(adapter, i);
1022 
1023  switch (adapter->hw.mac.type) {
1024  case e1000_82576:
1025  case e1000_i350:
1026  /* Enable VM to VM loopback by default */
1027  adapter->flags |= IGB_FLAG_LOOPBACK_ENABLE;
1028  break;
1029  default:
1030  /* Currently no other hardware supports loopback */
1031  break;
1032  }
1033 
1034  /* DMA Coalescing is not supported in IOV mode. */
1035  if (adapter->hw.mac.type >= e1000_i350)
1036  adapter->dmac = IGB_DMAC_DISABLE;
1037  if (adapter->hw.mac.type < e1000_i350)
1038  adapter->flags |= IGB_FLAG_DETECT_BAD_DMA;
1039  return;
1040 
1041  }
1042 
1043 err_out:
1044  kfree(adapter->vf_data);
1045  adapter->vf_data = NULL;
1046  adapter->vfs_allocated_count = 0;
1047  dev_warn(pci_dev_to_dev(pdev),
1048  "Failed to initialize SR-IOV virtualization\n");
1049 }
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
struct pci_dev * pdev
Definition: igb.h:582
unsigned int flags
Definition: igb.h:538
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
int dmac
Definition: igb.h:635
struct vf_data_storage * vf_data
Definition: igb.h:615
static int igb_vf_configure(struct igb_adapter *adapter, int vf)
Definition: igb_main.c:6403
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
#define IGB_DMAC_DISABLE
Definition: igb.h:741
#define IGB_FLAG_DETECT_BAD_DMA
Definition: igb.h:719
#define IGB_FLAG_LOOPBACK_ENABLE
Definition: igb.h:725
#define NULL
Null pointer value.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_set_uta ( struct igb_adapter adapter)
static

igb_set_uta - Set unicast filter table address : board private structure

The unicast table address is a register array of 32-bit registers. The table is meant to be used in a way similar to how the MTA is used however due to certain limitations in the hardware it is necessary to set all the hash bits to 1 and use the VMOLR ROPE bit as a promiscuous enable bit to allow vlan tag stripping when promiscuous mode is enabled

igb_main.c 파일의 7106 번째 라인에서 정의되었습니다.

7107 {
7108  struct e1000_hw *hw = &adapter->hw;
7109  int i;
7110 
7111  /* The UTA table only exists on 82576 hardware and newer */
7112  if (hw->mac.type < e1000_82576)
7113  return;
7114 
7115  /* we only need to do this if VMDq is enabled */
7116  if (!adapter->vmdq_pools)
7117  return;
7118 
7119  for (i = 0; i < hw->mac.uta_reg_count; i++)
7120  E1000_WRITE_REG_ARRAY(hw, E1000_UTA, i, ~0);
7121 }
#define E1000_WRITE_REG_ARRAY(hw, reg, idx, val)
Definition: e1000_osdep.h:100
struct e1000_hw hw
Definition: igb.h:594
#define E1000_UTA
Definition: e1000_regs.h:496
u16 uta_reg_count
Definition: e1000_hw.h:618
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
u32 vmdq_pools
Definition: igb.h:627

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_set_vf_mac ( struct igb_adapter adapter,
int  vf,
unsigned char *  mac_addr 
)
static

igb_main.c 파일의 9716 번째 라인에서 정의되었습니다.

9718 {
9719  struct e1000_hw *hw = &adapter->hw;
9720  /* VF MAC addresses start at end of receive addresses and moves
9721  * towards the first, as a result a collision should not be possible
9722  */
9723  int rar_entry = hw->mac.rar_entry_count - (vf + 1);
9724 
9725  memcpy(adapter->vf_data[vf].vf_mac_addresses, mac_addr, ETH_ALEN);
9726 
9727  igb_rar_set_qsel(adapter, mac_addr, rar_entry, vf);
9728 
9729  return 0;
9730 }
struct e1000_hw hw
Definition: igb.h:594
static void igb_rar_set_qsel(struct igb_adapter *, u8 *, u32, u8)
Definition: igb_main.c:4478
unsigned char vf_mac_addresses[ETH_ALEN]
Definition: igb.h:141
struct e1000_dev_spec_vf vf
Definition: e1000_hw.h:772
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define ETH_ALEN
struct vf_data_storage * vf_data
Definition: igb.h:615
u16 rar_entry_count
Definition: e1000_hw.h:623

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_set_vf_mac_addr ( struct igb_adapter adapter,
u32 msg,
int  vf 
)
static

igb_main.c 파일의 6959 번째 라인에서 정의되었습니다.

6960 {
6961  /*
6962  * The VF MAC Address is stored in a packed array of bytes
6963  * starting at the second 32 bit word of the msg array
6964  */
6965  unsigned char *addr = (unsigned char *)&msg[1];
6966  int err = -1;
6967 
6968  if (is_valid_ether_addr(addr))
6969  err = igb_set_vf_mac(adapter, vf, addr);
6970 
6971  return err;
6972 }
static char msg[LOG_MSG_LEN]
int err
struct e1000_dev_spec_vf vf
Definition: e1000_hw.h:772
static int igb_set_vf_mac(struct igb_adapter *, int, unsigned char *)
Definition: igb_main.c:9716

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_set_vf_multicasts ( struct igb_adapter adapter,
u32 msgbuf,
u32  vf 
)
static

igb_main.c 파일의 6519 번째 라인에서 정의되었습니다.

6521 {
6523  u16 *hash_list = (u16 *)&msgbuf[1];
6524  struct vf_data_storage *vf_data = &adapter->vf_data[vf];
6525  int i;
6526 
6527  /* salt away the number of multicast addresses assigned
6528  * to this VF for later use to restore when the PF multi cast
6529  * list changes
6530  */
6531  vf_data->num_vf_mc_hashes = n;
6532 
6533  /* only up to 30 hash values supported */
6534  if (n > 30)
6535  n = 30;
6536 
6537  /* store the hashes for later use */
6538  for (i = 0; i < n; i++)
6539  vf_data->vf_mc_hashes[i] = hash_list[i];
6540 
6541  /* Flush and reset the mta with the new values */
6542  igb_set_rx_mode(adapter->netdev);
6543 
6544  return 0;
6545 }
struct net_device * netdev
Definition: igb.h:535
#define E1000_VT_MSGINFO_SHIFT
Definition: e1000_mbx.h:53
#define E1000_VT_MSGINFO_MASK
Definition: e1000_mbx.h:55
u_int16_t u16
Definition: e1000_osdep.h:51
u16 vf_mc_hashes[IGB_MAX_VF_MC_ENTRIES]
Definition: igb.h:142
struct vf_data_storage * vf_data
Definition: igb.h:615
char * msgbuf
Definition: mrpValidate.c:75
static void igb_set_rx_mode(struct net_device *)
Definition: igb_main.c:4567
u16 num_vf_mc_hashes
Definition: igb.h:143

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_set_vf_promisc ( struct igb_adapter adapter,
u32 msgbuf,
u32  vf 
)
static

igb_main.c 파일의 6470 번째 라인에서 정의되었습니다.

6471 {
6472 
6473  struct e1000_hw *hw = &adapter->hw;
6474  u32 vmolr = E1000_READ_REG(hw, E1000_VMOLR(vf));
6475  struct vf_data_storage *vf_data = &adapter->vf_data[vf];
6476 
6477  vf_data->flags &= ~(IGB_VF_FLAG_UNI_PROMISC |
6480 
6481 #ifdef IGB_ENABLE_VF_PROMISC
6483  vmolr |= E1000_VMOLR_ROPE;
6484  vf_data->flags |= IGB_VF_FLAG_UNI_PROMISC;
6485  *msgbuf &= ~E1000_VF_SET_PROMISC_UNICAST;
6486  }
6487 #endif
6489  vmolr |= E1000_VMOLR_MPME;
6490  vf_data->flags |= IGB_VF_FLAG_MULTI_PROMISC;
6491  *msgbuf &= ~E1000_VF_SET_PROMISC_MULTICAST;
6492  } else {
6493  /*
6494  * if we have hashes and we are clearing a multicast promisc
6495  * flag we need to write the hashes to the MTA as this step
6496  * was previously skipped
6497  */
6498  if (vf_data->num_vf_mc_hashes > 30) {
6499  vmolr |= E1000_VMOLR_MPME;
6500  } else if (vf_data->num_vf_mc_hashes) {
6501  int j;
6502 
6503  vmolr |= E1000_VMOLR_ROMPE;
6504  for (j = 0; j < vf_data->num_vf_mc_hashes; j++)
6505  igb_mta_set(adapter, vf_data->vf_mc_hashes[j]);
6506  }
6507  }
6508 
6509  E1000_WRITE_REG(hw, E1000_VMOLR(vf), vmolr);
6510 
6511  /* there are flags left unprocessed, likely not supported */
6513  return -EINVAL;
6514 
6515  return 0;
6516 
6517 }
#define IGB_VF_FLAG_UNI_PROMISC
Definition: igb.h:161
#define E1000_VMOLR_ROPE
Definition: e1000_82575.h:419
struct e1000_hw hw
Definition: igb.h:594
void igb_mta_set(struct igb_adapter *adapter, u32 hash_value)
Definition: igb_main.c:6444
#define E1000_VF_SET_PROMISC_MULTICAST
Definition: e1000_mbx.h:67
#define E1000_VMOLR_MPME
Definition: e1000_82575.h:421
#define E1000_VMOLR_ROMPE
Definition: e1000_82575.h:418
struct e1000_dev_spec_vf vf
Definition: e1000_hw.h:772
#define E1000_VT_MSGINFO_MASK
Definition: e1000_mbx.h:55
u16 vf_mc_hashes[IGB_MAX_VF_MC_ENTRIES]
Definition: igb.h:142
struct vf_data_storage * vf_data
Definition: igb.h:615
char * msgbuf
Definition: mrpValidate.c:75
#define E1000_VF_SET_PROMISC_UNICAST
Definition: e1000_mbx.h:66
u16 num_vf_mc_hashes
Definition: igb.h:143
u32 flags
Definition: igb.h:148
#define E1000_VMOLR(_n)
Definition: e1000_regs.h:512
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
#define IGB_VF_FLAG_MULTI_PROMISC
Definition: igb.h:162

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_set_vf_rlpml ( struct igb_adapter adapter,
int  size,
int  vfn 
)
inlinestatic

igb_main.c 파일의 3900 번째 라인에서 정의되었습니다.

3902 {
3903  struct e1000_hw *hw = &adapter->hw;
3904  u32 vmolr;
3905 
3906  /* if it isn't the PF check to see if VFs are enabled and
3907  * increase the size to support vlan tags
3908  */
3909  if (vfn < adapter->vfs_allocated_count &&
3910  adapter->vf_data[vfn].vlans_enabled)
3911  size += VLAN_HLEN;
3912 
3913 #ifdef CONFIG_IGB_VMDQ_NETDEV
3914  if (vfn >= adapter->vfs_allocated_count) {
3915  int queue = vfn - adapter->vfs_allocated_count;
3916  struct igb_vmdq_adapter *vadapter;
3917 
3918  vadapter = netdev_priv(adapter->vmdq_netdev[queue-1]);
3919  if (vadapter->vlgrp)
3920  size += VLAN_HLEN;
3921  }
3922 #endif
3923  vmolr = E1000_READ_REG(hw, E1000_VMOLR(vfn));
3924  vmolr &= ~E1000_VMOLR_RLPML_MASK;
3925  vmolr |= size | E1000_VMOLR_LPE;
3926  E1000_WRITE_REG(hw, E1000_VMOLR(vfn), vmolr);
3927 
3928  return 0;
3929 }
#define E1000_VMOLR_RLPML_MASK
Definition: e1000_82575.h:414
struct e1000_hw hw
Definition: igb.h:594
#define E1000_VMOLR_LPE
Definition: e1000_82575.h:415
unsigned int vfs_allocated_count
Definition: igb.h:621
u16 vlans_enabled
Definition: igb.h:145
#define VLAN_HLEN
Definition: kcompat.h:292
struct vf_data_storage * vf_data
Definition: igb.h:615
int size
#define E1000_VMOLR(_n)
Definition: e1000_regs.h:512
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_set_vf_vlan ( struct igb_adapter adapter,
u32 msgbuf,
u32  vf 
)
static

igb_main.c 파일의 6813 번째 라인에서 정의되었습니다.

6814 {
6815  struct e1000_hw *hw = &adapter->hw;
6817  int vid = (msgbuf[1] & E1000_VLVF_VLANID_MASK);
6818  int err = 0;
6819 
6820  if (vid)
6821  igb_set_vf_vlan_strip(adapter, vf, true);
6822  else
6823  igb_set_vf_vlan_strip(adapter, vf, false);
6824 
6825  /* If in promiscuous mode we need to make sure the PF also has
6826  * the VLAN filter set.
6827  */
6828  if (add && (adapter->netdev->flags & IFF_PROMISC))
6829  err = igb_vlvf_set(adapter, vid, add,
6830  adapter->vfs_allocated_count);
6831  if (err)
6832  goto out;
6833 
6834  err = igb_vlvf_set(adapter, vid, add, vf);
6835 
6836  if (err)
6837  goto out;
6838 
6839  /* Go through all the checks to see if the VLAN filter should
6840  * be wiped completely.
6841  */
6842  if (!add && (adapter->netdev->flags & IFF_PROMISC)) {
6843  u32 vlvf, bits;
6844 
6845  int regndx = igb_find_vlvf_entry(adapter, vid);
6846 
6847  if (regndx < 0)
6848  goto out;
6849  /* See if any other pools are set for this VLAN filter
6850  * entry other than the PF.
6851  */
6852  vlvf = bits = E1000_READ_REG(hw, E1000_VLVF(regndx));
6853  bits &= 1 << (E1000_VLVF_POOLSEL_SHIFT +
6854  adapter->vfs_allocated_count);
6855  /* If the filter was removed then ensure PF pool bit
6856  * is cleared if the PF only added itself to the pool
6857  * because the PF is in promiscuous mode.
6858  */
6859  if ((vlvf & VLAN_VID_MASK) == vid &&
6860 #ifndef HAVE_VLAN_RX_REGISTER
6861  !test_bit(vid, adapter->active_vlans) &&
6862 #endif
6863  !bits)
6864  igb_vlvf_set(adapter, vid, add,
6865  adapter->vfs_allocated_count);
6866  }
6867 
6868 out:
6869  return err;
6870 }
static jack_default_audio_sample_t ** out
Definition: jack_listener.c:75
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
int err
#define E1000_VLVF(_n)
Definition: e1000_regs.h:514
struct net_device * netdev
Definition: igb.h:535
static int igb_find_vlvf_entry(struct igb_adapter *adapter, int vid)
Definition: igb_main.c:6793
#define E1000_VT_MSGINFO_SHIFT
Definition: e1000_mbx.h:53
struct e1000_dev_spec_vf vf
Definition: e1000_hw.h:772
#define E1000_VT_MSGINFO_MASK
Definition: e1000_mbx.h:55
s32 igb_vlvf_set(struct igb_adapter *adapter, u32 vid, bool add, u32 vf)
Definition: igb_main.c:6606
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]
Definition: igb.h:533
char * msgbuf
Definition: mrpValidate.c:75
static void igb_set_vf_vlan_strip(struct igb_adapter *adapter, int vfn, bool enable)
Definition: igb_main.c:3964
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_VLVF_POOLSEL_SHIFT
Definition: e1000_82575.h:436
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
#define E1000_VLVF_VLANID_MASK
Definition: e1000_82575.h:435

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_set_vf_vlan_strip ( struct igb_adapter adapter,
int  vfn,
bool  enable 
)
inlinestatic

igb_main.c 파일의 3964 번째 라인에서 정의되었습니다.

3966 {
3967  struct e1000_hw *hw = &adapter->hw;
3968  u32 val;
3969  void __iomem *reg;
3970 
3971  if (hw->mac.type < e1000_82576)
3972  return;
3973 
3974  if (hw->mac.type == e1000_i350)
3975  reg = hw->hw_addr + E1000_DVMOLR(vfn);
3976  else
3977  reg = hw->hw_addr + E1000_VMOLR(vfn);
3978 
3979  val = readl(reg);
3980  if (enable)
3981  val |= E1000_VMOLR_STRVLAN;
3982  else
3983  val &= ~(E1000_VMOLR_STRVLAN);
3984  writel(val, reg);
3985 }
struct e1000_hw hw
Definition: igb.h:594
#define E1000_VMOLR_STRVLAN
Definition: e1000_82575.h:422
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
u8 __iomem * hw_addr
Definition: e1000_hw.h:758
#define E1000_VMOLR(_n)
Definition: e1000_regs.h:512
#define E1000_DVMOLR(_n)
Definition: e1000_regs.h:516
u_int32_t u32
Definition: e1000_osdep.h:50

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_set_vmolr ( struct igb_adapter adapter,
int  vfn,
bool  aupe 
)
inlinestatic

igb_main.c 파일의 3986 번째 라인에서 정의되었습니다.

3988 {
3989  struct e1000_hw *hw = &adapter->hw;
3990  u32 vmolr;
3991 
3992  /*
3993  * This register exists only on 82576 and newer so if we are older then
3994  * we should exit and do nothing
3995  */
3996  if (hw->mac.type < e1000_82576)
3997  return;
3998 
3999  vmolr = E1000_READ_REG(hw, E1000_VMOLR(vfn));
4000 
4001  if (aupe)
4002  vmolr |= E1000_VMOLR_AUPE; /* Accept untagged packets */
4003  else
4004  vmolr &= ~(E1000_VMOLR_AUPE); /* Tagged packets ONLY */
4005 
4006  /* clear all bits that might not be set */
4007  vmolr &= ~E1000_VMOLR_RSSE;
4008 
4009  if (adapter->rss_queues > 1 && vfn == adapter->vfs_allocated_count)
4010  vmolr |= E1000_VMOLR_RSSE; /* enable RSS */
4011 
4012  vmolr |= E1000_VMOLR_BAM; /* Accept broadcast */
4013  vmolr |= E1000_VMOLR_LPE; /* Accept long packets */
4014 
4015  E1000_WRITE_REG(hw, E1000_VMOLR(vfn), vmolr);
4016 }
struct e1000_hw hw
Definition: igb.h:594
#define E1000_VMOLR_LPE
Definition: e1000_82575.h:415
unsigned int vfs_allocated_count
Definition: igb.h:621
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
u32 rss_queues
Definition: igb.h:625
#define E1000_VMOLR_RSSE
Definition: e1000_82575.h:416
#define E1000_VMOLR(_n)
Definition: e1000_regs.h:512
#define E1000_VMOLR_AUPE
Definition: e1000_82575.h:417
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_VMOLR_BAM
Definition: e1000_82575.h:420
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_setup_all_rx_resources ( struct igb_adapter adapter)
static

igb_setup_all_rx_resources - wrapper to allocate Rx resources (Descriptors) for all queues : board private structure

Return 0 on success, negative on failure

igb_main.c 파일의 3698 번째 라인에서 정의되었습니다.

3699 {
3700  struct pci_dev *pdev = adapter->pdev;
3701  int i, err = 0;
3702 
3703  for (i = 0; i < adapter->num_rx_queues; i++) {
3704  err = igb_setup_rx_resources(adapter->rx_ring[i]);
3705  if (err) {
3706  dev_err(pci_dev_to_dev(pdev),
3707  "Allocation for Rx Queue %u failed\n", i);
3708  for (i--; i >= 0; i--)
3709  igb_free_rx_resources(adapter->rx_ring[i]);
3710  break;
3711  }
3712  }
3713 
3714  return err;
3715 }
int err
struct pci_dev * pdev
Definition: igb.h:582
int num_rx_queues
Definition: igb.h:551
struct igb_ring * rx_ring[IGB_MAX_RX_QUEUES]
Definition: igb.h:552
int igb_setup_rx_resources(struct igb_ring *rx_ring)
Definition: igb_main.c:3655
void igb_free_rx_resources(struct igb_ring *rx_ring)
Definition: igb_main.c:4243
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_setup_all_tx_resources ( struct igb_adapter adapter)
static

igb_setup_all_tx_resources - wrapper to allocate Tx resources (Descriptors) for all queues : board private structure

Return 0 on success, negative on failure

igb_main.c 파일의 3535 번째 라인에서 정의되었습니다.

3536 {
3537  struct pci_dev *pdev = adapter->pdev;
3538  int i, err = 0;
3539 
3540  for (i = 0; i < adapter->num_tx_queues; i++) {
3541  err = igb_setup_tx_resources(adapter->tx_ring[i]);
3542  if (err) {
3543  dev_err(pci_dev_to_dev(pdev),
3544  "Allocation for Tx Queue %u failed\n", i);
3545  for (i--; i >= 0; i--)
3546  igb_free_tx_resources(adapter->tx_ring[i]);
3547  break;
3548  }
3549  }
3550 
3551  return err;
3552 }
int err
struct pci_dev * pdev
Definition: igb.h:582
int num_tx_queues
Definition: igb.h:547
void igb_free_tx_resources(struct igb_ring *tx_ring)
Definition: igb_main.c:4141
struct igb_ring * tx_ring[IGB_MAX_TX_QUEUES]
Definition: igb.h:548
int igb_setup_tx_resources(struct igb_ring *tx_ring)
Definition: igb_main.c:3496
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_setup_mrqc ( struct igb_adapter adapter)
static

igb_setup_mrqc - configure the multiple receive queue control registers : Board private structure

igb_main.c 파일의 3721 번째 라인에서 정의되었습니다.

3722 {
3723  struct e1000_hw *hw = &adapter->hw;
3724  u32 mrqc, rxcsum;
3725  u32 j, num_rx_queues;
3726 #ifndef ETHTOOL_SRXFHINDIR
3727  u32 shift = 0, shift2 = 0;
3728 #endif /* ETHTOOL_SRXFHINDIR */
3729  static const u32 rsskey[10] = { 0xDA565A6D, 0xC20E5B25, 0x3D256741,
3730  0xB08FA343, 0xCB2BCAD0, 0xB4307BAE,
3731  0xA32DCB77, 0x0CF23080, 0x3BB7426A,
3732  0xFA01ACBE };
3733 
3734  /* Fill out hash function seeds */
3735  for (j = 0; j < 10; j++)
3736  E1000_WRITE_REG(hw, E1000_RSSRK(j), rsskey[j]);
3737 
3738  num_rx_queues = adapter->rss_queues;
3739 
3740 #ifdef ETHTOOL_SRXFHINDIR
3741  if (hw->mac.type == e1000_82576) {
3742  /* 82576 supports 2 RSS queues for SR-IOV */
3743  if (adapter->vfs_allocated_count)
3744  num_rx_queues = 2;
3745  }
3746  if (adapter->rss_indir_tbl_init != num_rx_queues) {
3747  for (j = 0; j < IGB_RETA_SIZE; j++)
3748  adapter->rss_indir_tbl[j] =
3749  (j * num_rx_queues) / IGB_RETA_SIZE;
3750  adapter->rss_indir_tbl_init = num_rx_queues;
3751  }
3752  igb_write_rss_indir_tbl(adapter);
3753 #else
3754  /* 82575 and 82576 supports 2 RSS queues for VMDq */
3755  switch (hw->mac.type) {
3756  case e1000_82575:
3757  if (adapter->vmdq_pools) {
3758  shift = 2;
3759  shift2 = 6;
3760  }
3761  shift = 6;
3762  break;
3763  case e1000_82576:
3764  /* 82576 supports 2 RSS queues for SR-IOV */
3765  if (adapter->vfs_allocated_count || adapter->vmdq_pools) {
3766  shift = 3;
3767  num_rx_queues = 2;
3768  }
3769  break;
3770  default:
3771  break;
3772  }
3773 
3774  /*
3775  * Populate the redirection table 4 entries at a time. To do this
3776  * we are generating the results for n and n+2 and then interleaving
3777  * those with the results with n+1 and n+3.
3778  */
3779  for (j = 0; j < 32; j++) {
3780  /* first pass generates n and n+2 */
3781  u32 base = ((j * 0x00040004) + 0x00020000) * num_rx_queues;
3782  u32 reta = (base & 0x07800780) >> (7 - shift);
3783 
3784  /* second pass generates n+1 and n+3 */
3785  base += 0x00010001 * num_rx_queues;
3786  reta |= (base & 0x07800780) << (1 + shift);
3787 
3788  /* generate 2nd table for 82575 based parts */
3789  if (shift2)
3790  reta |= (0x01010101 * num_rx_queues) << shift2;
3791 
3792  E1000_WRITE_REG(hw, E1000_RETA(j), reta);
3793  }
3794 #endif /* ETHTOOL_SRXFHINDIR */
3795 
3796  /*
3797  * Disable raw packet checksumming so that RSS hash is placed in
3798  * descriptor on writeback. No need to enable TCP/UDP/IP checksum
3799  * offloads as they are enabled by default
3800  */
3801  rxcsum = E1000_READ_REG(hw, E1000_RXCSUM);
3802  rxcsum |= E1000_RXCSUM_PCSD;
3803 
3804  if (adapter->hw.mac.type >= e1000_82576)
3805  /* Enable Receive Checksum Offload for SCTP */
3806  rxcsum |= E1000_RXCSUM_CRCOFL;
3807 
3808  /* Don't need to set TUOFL or IPOFL, they default to 1 */
3809  E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum);
3810 
3811  /* Generate RSS hash based on packet types, TCP/UDP
3812  * port numbers and/or IPv4/v6 src and dst addresses
3813  */
3814  mrqc = E1000_MRQC_RSS_FIELD_IPV4 |
3819 
3820  if (adapter->flags & IGB_FLAG_RSS_FIELD_IPV4_UDP)
3822  if (adapter->flags & IGB_FLAG_RSS_FIELD_IPV6_UDP)
3824 
3825  /* If VMDq is enabled then we set the appropriate mode for that, else
3826  * we default to RSS so that an RSS hash is calculated per packet even
3827  * if we are only using one queue
3828  */
3829  if (adapter->vfs_allocated_count || adapter->vmdq_pools) {
3830  if (hw->mac.type > e1000_82575) {
3831  /* Set the default pool for the PF's first queue */
3832  u32 vtctl = E1000_READ_REG(hw, E1000_VT_CTL);
3833 
3834  vtctl &= ~(E1000_VT_CTL_DEFAULT_POOL_MASK |
3836  vtctl |= adapter->vfs_allocated_count <<
3838  E1000_WRITE_REG(hw, E1000_VT_CTL, vtctl);
3839  }
3840  if (adapter->rss_queues > 1)
3842  else
3843  mrqc |= E1000_MRQC_ENABLE_VMDQ;
3844  } else {
3845  mrqc |= E1000_MRQC_ENABLE_RSS_4Q;
3846  }
3847  igb_vmm_control(adapter);
3848 
3849  /* AVB specific use queue 3 for all non-filtered packets */
3850 #define E1000_MRQC_ENABLE_DEF_Q3 (3 << 3)
3851  mrqc = E1000_MRQC_ENABLE_DEF_Q3; /* AVB specific */
3852  E1000_WRITE_REG(hw, E1000_MRQC, mrqc);
3853 }
#define E1000_VT_CTL_DISABLE_DEF_POOL
Definition: e1000_82575.h:410
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
#define E1000_MRQC_RSS_FIELD_IPV6_TCP_EX
static void igb_vmm_control(struct igb_adapter *)
Definition: igb_main.c:9881
#define E1000_MRQC_RSS_FIELD_IPV6
unsigned int flags
Definition: igb.h:538
#define E1000_MRQC_RSS_FIELD_IPV6_UDP
Definition: e1000_82575.h:137
#define E1000_RXCSUM_PCSD
#define IGB_FLAG_RSS_FIELD_IPV4_UDP
Definition: igb.h:721
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define E1000_RXCSUM
Definition: e1000_regs.h:418
enum e1000_mac_type type
Definition: e1000_hw.h:602
u32 vmdq_pools
Definition: igb.h:627
u32 rss_queues
Definition: igb.h:625
#define E1000_RETA(_i)
Definition: e1000_regs.h:481
#define E1000_MRQC
Definition: e1000_regs.h:476
#define E1000_RXCSUM_CRCOFL
#define E1000_VT_CTL
Definition: e1000_regs.h:425
#define E1000_MRQC_ENABLE_RSS_4Q
Definition: e1000_82575.h:133
#define E1000_MRQC_RSS_FIELD_IPV4_TCP
#define E1000_VT_CTL_DEFAULT_POOL_MASK
Definition: e1000_82575.h:406
#define E1000_MRQC_ENABLE_VMDQ_RSS_2Q
Definition: e1000_82575.h:135
#define E1000_VT_CTL_DEFAULT_POOL_SHIFT
Definition: e1000_82575.h:405
#define E1000_MRQC_RSS_FIELD_IPV4_UDP
Definition: e1000_82575.h:136
#define E1000_MRQC_RSS_FIELD_IPV6_TCP
#define E1000_MRQC_RSS_FIELD_IPV4
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_MRQC_ENABLE_VMDQ
Definition: e1000_82575.h:134
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_RSSRK(_i)
Definition: e1000_regs.h:482
#define IGB_FLAG_RSS_FIELD_IPV6_UDP
Definition: igb.h:722
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
#define E1000_MRQC_ENABLE_DEF_Q3

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

int igb_setup_queues ( struct igb_adapter adapter)

igb_main.c 파일의 9212 번째 라인에서 정의되었습니다.

9213 {
9214  struct net_device *dev = adapter->netdev;
9215  int err;
9216 
9217  if (adapter->rss_queues == adapter->num_rx_queues) {
9218  if (adapter->tss_queues) {
9219  if (adapter->tss_queues == adapter->num_tx_queues)
9220  return 0;
9221  } else if (adapter->vfs_allocated_count ||
9222  adapter->rss_queues == adapter->num_tx_queues) {
9223  return 0;
9224  }
9225  }
9226 
9227  /*
9228  * Hardware has to reinitialize queues and interrupts to
9229  * match the new configuration. Unfortunately, the hardware
9230  * is not flexible enough to do this dynamically.
9231  */
9232  if (netif_running(dev))
9233  igb_close(dev);
9234 
9235  igb_clear_interrupt_scheme(adapter);
9236 
9237  err = igb_init_interrupt_scheme(adapter, true);
9238  if (err) {
9239  dev_close(dev);
9240  return err;
9241  }
9242 
9243  if (netif_running(dev))
9244  err = igb_open(dev);
9245 
9246  return err;
9247 }
u32 tss_queues
Definition: igb.h:626
unsigned int vfs_allocated_count
Definition: igb.h:621
int err
static int igb_open(struct net_device *)
Definition: igb_main.c:3436
struct net_device * netdev
Definition: igb.h:535
static void igb_clear_interrupt_scheme(struct igb_adapter *adapter)
Definition: igb_main.c:855
int num_tx_queues
Definition: igb.h:547
int num_rx_queues
Definition: igb.h:551
u32 rss_queues
Definition: igb.h:625
static int igb_close(struct net_device *)
Definition: igb_main.c:3485
static int igb_init_interrupt_scheme(struct igb_adapter *adapter, bool msix)
Definition: igb_main.c:1343

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

void igb_setup_rctl ( struct igb_adapter adapter)

igb_setup_rctl - configure the receive control registers : Board private structure

igb_main.c 파일의 3859 번째 라인에서 정의되었습니다.

3860 {
3861  struct e1000_hw *hw = &adapter->hw;
3862  u32 rctl;
3863 
3864  rctl = E1000_READ_REG(hw, E1000_RCTL);
3865 
3866  rctl &= ~(3 << E1000_RCTL_MO_SHIFT);
3868 
3871 
3872  /*
3873  * enable stripping of CRC. It's unlikely this will break BMC
3874  * redirection as it did with e1000. Newer features require
3875  * that the HW strips the CRC.
3876  */
3877  rctl |= E1000_RCTL_SECRC;
3878 
3879  /* disable store bad packets and clear size bits. */
3880  rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_SZ_256);
3881 
3882  /* enable LPE to prevent packets larger than max_frame_size */
3883  rctl |= E1000_RCTL_LPE;
3884 
3885  /* disable queue 0 to prevent tail write w/o re-config */
3886  E1000_WRITE_REG(hw, E1000_RXDCTL(0), 0);
3887 
3888  /* Attention!!! For SR-IOV PF driver operations you must enable
3889  * queue drop for all VF and PF queues to prevent head of line blocking
3890  * if an un-trusted VF does not provide descriptors to hardware.
3891  */
3892  if (adapter->vfs_allocated_count) {
3893  /* set all queue drop enable bits */
3895  }
3896 
3897  E1000_WRITE_REG(hw, E1000_RCTL, rctl);
3898 }
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
#define ALL_QUEUES
Definition: e1000_82575.h:463
#define E1000_RCTL_EN
#define E1000_RCTL
Definition: e1000_regs.h:61
#define E1000_QDE
Definition: e1000_regs.h:492
#define E1000_RCTL_BAM
#define E1000_RCTL_MO_SHIFT
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define E1000_RCTL_LBM_MAC
#define E1000_RCTL_SBP
#define E1000_RCTL_RDMTS_HALF
#define E1000_RCTL_LBM_TCVR
#define E1000_RCTL_LPE
#define E1000_RCTL_SECRC
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_RXDCTL(_n)
Definition: e1000_regs.h:200
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
u32 mc_filter_type
Definition: e1000_hw.h:608
#define E1000_RCTL_SZ_256

이 함수를 호출하는 함수들에 대한 그래프입니다.:

int igb_setup_rx_resources ( struct igb_ring rx_ring)

igb_setup_rx_resources - allocate Rx resources (Descriptors) : rx descriptor ring (for a specific queue) to setup

Returns 0 on success, negative on failure

igb_main.c 파일의 3655 번째 라인에서 정의되었습니다.

3656 {
3657  struct device *dev = rx_ring->dev;
3658  int size, desc_len;
3659 
3660  size = sizeof(struct igb_rx_buffer) * rx_ring->count;
3661  rx_ring->rx_buffer_info = vzalloc(size);
3662  if (!rx_ring->rx_buffer_info)
3663  goto err;
3664 
3665  desc_len = sizeof(union e1000_adv_rx_desc);
3666 
3667  /* Round up to nearest 4K */
3668  rx_ring->size = rx_ring->count * desc_len;
3669  rx_ring->size = ALIGN(rx_ring->size, 4096);
3670 
3671  rx_ring->desc = dma_alloc_coherent(dev, rx_ring->size,
3672  &rx_ring->dma, GFP_KERNEL);
3673 
3674  if (!rx_ring->desc)
3675  goto err;
3676 
3677  rx_ring->next_to_alloc = 0;
3678  rx_ring->next_to_clean = 0;
3679  rx_ring->next_to_use = 0;
3680 
3681  return 0;
3682 
3683 err:
3684  vfree(rx_ring->rx_buffer_info);
3685  rx_ring->rx_buffer_info = NULL;
3686  dev_err(dev,
3687  "Unable to allocate memory for the receive descriptor ring\n");
3688  return -ENOMEM;
3689 }
u16 count
Definition: igb.h:379
struct device * dev
Definition: igb.h:368
int err
struct igb_rx_buffer * rx_buffer_info
Definition: igb.h:371
unsigned int size
Definition: igb.h:377
u16 next_to_clean
Definition: igb.h:384
u16 next_to_use
Definition: igb.h:385
void * desc
Definition: igb.h:373
int size
u16 next_to_alloc
Definition: igb.h:386
dma_addr_t dma
Definition: igb.h:376
#define NULL
Null pointer value.

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_setup_tctl ( struct igb_adapter adapter)

igb_setup_tctl - configure the transmit control registers : Board private structure

igb_main.c 파일의 3558 번째 라인에서 정의되었습니다.

3559 {
3560  struct e1000_hw *hw = &adapter->hw;
3561  u32 tctl;
3562 
3563  /* disable queue 0 which is enabled by default on 82575 and 82576 */
3564  E1000_WRITE_REG(hw, E1000_TXDCTL(0), 0);
3565 
3566  /* Program the Transmit Control Register */
3567  tctl = E1000_READ_REG(hw, E1000_TCTL);
3568  tctl &= ~E1000_TCTL_CT;
3569  tctl |= E1000_TCTL_PSP | E1000_TCTL_RTLC |
3571 
3573 
3574  /* Enable transmits */
3575  tctl |= E1000_TCTL_EN;
3576 
3577  E1000_WRITE_REG(hw, E1000_TCTL, tctl);
3578 }
struct e1000_hw hw
Definition: igb.h:594
#define E1000_TXDCTL(_n)
Definition: e1000_regs.h:217
#define E1000_TCTL_EN
#define E1000_TCTL_PSP
#define E1000_TCTL_CT
#define E1000_CT_SHIFT
#define E1000_TCTL_RTLC
#define E1000_COLLISION_THRESHOLD
#define E1000_TCTL
Definition: e1000_regs.h:75
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
void e1000_config_collision_dist(struct e1000_hw *hw)
Definition: e1000_api.c:616
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

int igb_setup_tx_resources ( struct igb_ring tx_ring)

igb_setup_tx_resources - allocate Tx resources (Descriptors) : tx descriptor ring (for a specific queue) to setup

Return 0 on success, negative on failure

igb_main.c 파일의 3496 번째 라인에서 정의되었습니다.

3497 {
3498  struct device *dev = tx_ring->dev;
3499  int size;
3500 
3501  size = sizeof(struct igb_tx_buffer) * tx_ring->count;
3502  tx_ring->tx_buffer_info = vzalloc(size);
3503  if (!tx_ring->tx_buffer_info)
3504  goto err;
3505 
3506  /* round up to nearest 4K */
3507  tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc);
3508  tx_ring->size = ALIGN(tx_ring->size, 4096);
3509 
3510  tx_ring->desc = dma_alloc_coherent(dev, tx_ring->size,
3511  &tx_ring->dma, GFP_KERNEL);
3512 
3513  if (!tx_ring->desc)
3514  goto err;
3515 
3516  tx_ring->next_to_use = 0;
3517  tx_ring->next_to_clean = 0;
3518 
3519  return 0;
3520 
3521 err:
3522  vfree(tx_ring->tx_buffer_info);
3523  dev_err(dev,
3524  "Unable to allocate memory for the transmit descriptor ring\n");
3525  return -ENOMEM;
3526 }
u16 count
Definition: igb.h:379
struct device * dev
Definition: igb.h:368
int err
unsigned int size
Definition: igb.h:377
u16 next_to_clean
Definition: igb.h:384
u16 next_to_use
Definition: igb.h:385
void * desc
Definition: igb.h:373
int size
struct igb_tx_buffer * tx_buffer_info
Definition: igb.h:370
dma_addr_t dma
Definition: igb.h:376

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_shutdown ( struct pci_dev *  pdev)
static

igb_main.c 파일의 9466 번째 라인에서 정의되었습니다.

9467 {
9468  bool wake = false;
9469 
9470  __igb_shutdown(pdev, &wake, 0);
9471 
9472  if (system_state == SYSTEM_POWER_OFF) {
9473  pci_wake_from_d3(pdev, wake);
9474  pci_set_power_state(pdev, PCI_D3hot);
9475  }
9476 }
static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake, bool runtime)
Definition: igb_main.c:9249

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

static void igb_spoof_check ( struct igb_adapter adapter)
static

igb_main.c 파일의 4658 번째 라인에서 정의되었습니다.

4659 {
4660  int j;
4661 
4662  if (!adapter->wvbr)
4663  return;
4664 
4665  switch (adapter->hw.mac.type) {
4666  case e1000_82576:
4667  for (j = 0; j < adapter->vfs_allocated_count; j++) {
4668  if (adapter->wvbr & (1 << j) ||
4669  adapter->wvbr & (1 << (j
4671  DPRINTK(DRV, WARNING,
4672  "Spoof event(s) detected on VF %d\n",
4673  j);
4674  adapter->wvbr &=
4675  ~((1 << j) |
4676  (1 << (j +
4678  }
4679  }
4680  break;
4681  case e1000_i350:
4682  for (j = 0; j < adapter->vfs_allocated_count; j++) {
4683  if (adapter->wvbr & (1 << j)) {
4684  DPRINTK(DRV, WARNING,
4685  "Spoof event(s) detected on VF %d\n",
4686  j);
4687  adapter->wvbr &= ~(1 << j);
4688  }
4689  }
4690  break;
4691  default:
4692  break;
4693  }
4694 }
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
u32 wvbr
Definition: igb.h:629
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
#define IGB_STAGGERED_QUEUE_OFFSET
Definition: igb_main.c:4656
#define DPRINTK(nlevel, klevel, fmt, args...)
Definition: igb.h:75

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_sw_init ( struct igb_adapter adapter)
static

igb_sw_init - Initialize general software structures (struct igb_adapter) : board private structure to initialize

igb_sw_init initializes the Adapter private data structure. Fields are initialized based on PCI device information and OS network device settings (MTU size).

igb_main.c 파일의 3255 번째 라인에서 정의되었습니다.

3256 {
3257  struct e1000_hw *hw = &adapter->hw;
3258  struct net_device *netdev = adapter->netdev;
3259  struct pci_dev *pdev = adapter->pdev;
3260 
3261  /* PCI config space info */
3262 
3263  hw->vendor_id = pdev->vendor;
3264  hw->device_id = pdev->device;
3265  hw->subsystem_vendor_id = pdev->subsystem_vendor;
3266  hw->subsystem_device_id = pdev->subsystem_device;
3267 
3268  pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id);
3269 
3270  pci_read_config_word(pdev, PCI_COMMAND, &hw->bus.pci_cmd_word);
3271 
3272  /* set default ring sizes */
3273  adapter->tx_ring_count = tx_size;
3274  printk(KERN_INFO "igb_avb adapter->tx_ring_size %d", tx_size);
3275  adapter->rx_ring_count = IGB_DEFAULT_RXD;
3276 
3277  /* set default work limits */
3279 
3280  adapter->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN +
3281  VLAN_HLEN;
3282 
3283  /* Initialize the hardware-specific values */
3284  if (e1000_setup_init_funcs(hw, TRUE)) {
3285  dev_err(pci_dev_to_dev(pdev), "Hardware Initialization Failure\n");
3286  return -EIO;
3287  }
3288 
3289  igb_check_options(adapter);
3290 
3291  adapter->mac_table = kzalloc(sizeof(struct igb_mac_addr) *
3292  hw->mac.rar_entry_count,
3293  GFP_ATOMIC);
3294 
3295  /* Setup and initialize a copy of the hw vlan table array */
3296  adapter->shadow_vfta = kzalloc(sizeof(u32) * E1000_VFTA_ENTRIES,
3297  GFP_ATOMIC);
3298 
3299  /* These calls may decrease the number of queues */
3300  if (hw->mac.type < e1000_i210)
3301  igb_set_sriov_capability(adapter);
3302 
3303  if (igb_init_interrupt_scheme(adapter, true)) {
3304  dev_err(pci_dev_to_dev(pdev), "Unable to allocate memory for queues\n");
3305  return -ENOMEM;
3306  }
3307 
3308  /* Explicitly disable IRQ since the NIC can be in any state. */
3309  igb_irq_disable(adapter);
3310 
3311  set_bit(__IGB_DOWN, &adapter->state);
3312  return 0;
3313 }
struct e1000_hw hw
Definition: igb.h:594
struct e1000_bus_info bus
Definition: e1000_hw.h:766
static void igb_irq_disable(struct igb_adapter *adapter)
Definition: igb_main.c:1438
struct net_device * netdev
Definition: igb.h:535
u16 tx_ring_count
Definition: igb.h:613
struct pci_dev * pdev
Definition: igb.h:582
u16 tx_work_limit
Definition: igb.h:545
u32 max_frame_size
Definition: igb.h:579
u16 subsystem_device_id
Definition: e1000_hw.h:777
u16 pci_cmd_word
Definition: e1000_hw.h:696
s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device)
Definition: e1000_api.c:223
struct e1000_mac_info mac
Definition: e1000_hw.h:762
u16 vendor_id
Definition: e1000_hw.h:778
void igb_check_options(struct igb_adapter *)
Definition: igb_param.c:324
enum e1000_mac_type type
Definition: e1000_hw.h:602
static int tx_size
Definition: igb_main.c:382
#define IGB_DEFAULT_RXD
Definition: igb.h:115
u16 device_id
Definition: e1000_hw.h:775
unsigned long state
Definition: igb.h:537
u16 subsystem_vendor_id
Definition: e1000_hw.h:776
#define VLAN_HLEN
Definition: kcompat.h:292
u32 * shadow_vfta
Definition: igb.h:636
struct igb_mac_addr * mac_table
Definition: igb.h:630
#define E1000_VFTA_ENTRIES
u16 rx_ring_count
Definition: igb.h:614
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
static int igb_init_interrupt_scheme(struct igb_adapter *adapter, bool msix)
Definition: igb_main.c:1343
#define TRUE
Definition: maap_log.h:91
static void igb_set_sriov_capability(struct igb_adapter *adapter)
Definition: igb_main.c:992
u_int32_t u32
Definition: e1000_osdep.h:50
u8 revision_id
Definition: e1000_hw.h:780
#define IGB_DEFAULT_TX_WORK
Definition: igb.h:111
u16 rar_entry_count
Definition: e1000_hw.h:623

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_sync_mac_table ( struct igb_adapter adapter)

igb_main.c 파일의 4454 번째 라인에서 정의되었습니다.

4455 {
4456  struct e1000_hw *hw = &adapter->hw;
4457  int i;
4458 
4459  for (i = 0; i < hw->mac.rar_entry_count; i++) {
4460  if (adapter->mac_table[i].state & IGB_MAC_STATE_MODIFIED)
4461  igb_rar_set(adapter, i);
4462  adapter->mac_table[i].state &= ~(IGB_MAC_STATE_MODIFIED);
4463  }
4464 }
struct e1000_hw hw
Definition: igb.h:594
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define IGB_MAC_STATE_MODIFIED
Definition: igb.h:451
struct igb_mac_addr * mac_table
Definition: igb.h:630
u16 rar_entry_count
Definition: e1000_hw.h:623
void igb_rar_set(struct igb_adapter *adapter, u32 index)
Definition: igb_main.c:2589
u16 state
Definition: igb.h:448

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_tso ( struct igb_ring tx_ring,
struct igb_tx_buffer first,
u8 hdr_len 
)
static

igb_main.c 파일의 5289 번째 라인에서 정의되었습니다.

5292 {
5293 #ifdef NETIF_F_TSO
5294  struct sk_buff *skb = first->skb;
5295  u32 vlan_macip_lens, type_tucmd;
5296  u32 mss_l4len_idx, l4len;
5297 
5298  if (skb->ip_summed != CHECKSUM_PARTIAL)
5299  return 0;
5300 
5301  if (!skb_is_gso(skb))
5302 #endif /* NETIF_F_TSO */
5303  return 0;
5304 #ifdef NETIF_F_TSO
5305 
5306  if (skb_header_cloned(skb)) {
5307  int err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
5308 
5309  if (err)
5310  return err;
5311  }
5312 
5313  /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */
5314  type_tucmd = E1000_ADVTXD_TUCMD_L4T_TCP;
5315 
5316  if (first->protocol == htons(ETH_P_IP)) {
5317  struct iphdr *iph = ip_hdr(skb);
5318 
5319  iph->tot_len = 0;
5320  iph->check = 0;
5321  tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
5322  iph->daddr, 0,
5323  IPPROTO_TCP,
5324  0);
5325  type_tucmd |= E1000_ADVTXD_TUCMD_IPV4;
5326  first->tx_flags |= IGB_TX_FLAGS_TSO |
5329 #ifdef NETIF_F_TSO6
5330  } else if (skb_is_gso_v6(skb)) {
5331  ipv6_hdr(skb)->payload_len = 0;
5332  tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
5333  &ipv6_hdr(skb)->daddr,
5334  0, IPPROTO_TCP, 0);
5335  first->tx_flags |= IGB_TX_FLAGS_TSO |
5337 #endif
5338  }
5339 
5340  /* compute header lengths */
5341  l4len = tcp_hdrlen(skb);
5342  *hdr_len = skb_transport_offset(skb) + l4len;
5343 
5344  /* update gso size and bytecount with header size */
5345  first->gso_segs = skb_shinfo(skb)->gso_segs;
5346  first->bytecount += (first->gso_segs - 1) * *hdr_len;
5347 
5348  /* MSS L4LEN IDX */
5349  mss_l4len_idx = l4len << E1000_ADVTXD_L4LEN_SHIFT;
5350  mss_l4len_idx |= skb_shinfo(skb)->gso_size << E1000_ADVTXD_MSS_SHIFT;
5351 
5352  /* VLAN MACLEN IPLEN */
5353  vlan_macip_lens = skb_network_header_len(skb);
5354  vlan_macip_lens |= skb_network_offset(skb) << E1000_ADVTXD_MACLEN_SHIFT;
5355  vlan_macip_lens |= first->tx_flags & IGB_TX_FLAGS_VLAN_MASK;
5356 
5357  igb_tx_ctxtdesc(tx_ring, vlan_macip_lens, type_tucmd, mss_l4len_idx);
5358 
5359  return 1;
5360 #endif /* NETIF_F_TSO */
5361 }
int err
struct sk_buff * skb
Definition: igb.h:310
__be16 protocol
Definition: igb.h:313
unsigned int bytecount
Definition: igb.h:311
u32 tx_flags
Definition: igb.h:317
#define E1000_ADVTXD_MSS_SHIFT
Definition: e1000_82575.h:326
#define CHECKSUM_PARTIAL
Definition: kcompat.h:241
#define E1000_ADVTXD_TUCMD_IPV4
Definition: e1000_82575.h:315
#define skb_header_cloned(x)
Definition: kcompat.h:201
#define E1000_ADVTXD_TUCMD_L4T_TCP
Definition: e1000_82575.h:318
void igb_tx_ctxtdesc(struct igb_ring *tx_ring, u32 vlan_macip_lens, u32 type_tucmd, u32 mss_l4len_idx)
Definition: igb_main.c:5265
#define E1000_ADVTXD_MACLEN_SHIFT
Definition: e1000_82575.h:313
u16 gso_segs
Definition: igb.h:312
#define IGB_TX_FLAGS_VLAN_MASK
Definition: igb.h:285
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_ADVTXD_L4LEN_SHIFT
Definition: e1000_82575.h:325

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_tsync_interrupt ( struct igb_adapter adapter)
static

igb_main.c 파일의 6122 번째 라인에서 정의되었습니다.

6123 {
6124  struct e1000_hw *hw = &adapter->hw;
6125  struct ptp_clock_event event;
6126  struct timespec64 ts;
6127  u32 ack = 0, tsauxc, sec, nsec, tsicr = E1000_READ_REG(hw, E1000_TSICR);
6128 
6129  if (tsicr & TSINTR_SYS_WRAP) {
6130  event.type = PTP_CLOCK_PPS;
6131  if (adapter->ptp_caps.pps)
6132  ptp_clock_event(adapter->ptp_clock, &event);
6133  else
6134  dev_err(&adapter->pdev->dev, "unexpected SYS WRAP");
6135  ack |= TSINTR_SYS_WRAP;
6136  }
6137 
6138  if (tsicr & E1000_TSICR_TXTS) {
6139  /* retrieve hardware timestamp */
6140  schedule_work(&adapter->ptp_tx_work);
6141  ack |= E1000_TSICR_TXTS;
6142  }
6143 
6144  if (tsicr & TSINTR_TT0) {
6145  spin_lock(&adapter->tmreg_lock);
6146  ts = timespec64_add(adapter->perout[0].start,
6147  adapter->perout[0].period);
6148  /* u32 conversion of tv_sec is safe until y2106 */
6149  E1000_WRITE_REG(hw, E1000_TRGTTIML0, ts.tv_nsec);
6150  E1000_WRITE_REG(hw, E1000_TRGTTIMH0, (u32)ts.tv_sec);
6151  tsauxc = E1000_READ_REG(hw, E1000_TSAUXC);
6152  tsauxc |= TSAUXC_EN_TT0;
6153  E1000_WRITE_REG(hw, E1000_TSAUXC, tsauxc);
6154  adapter->perout[0].start = ts;
6155  spin_unlock(&adapter->tmreg_lock);
6156  ack |= TSINTR_TT0;
6157  }
6158 
6159  if (tsicr & TSINTR_TT1) {
6160  spin_lock(&adapter->tmreg_lock);
6161  ts = timespec64_add(adapter->perout[1].start,
6162  adapter->perout[1].period);
6163  E1000_WRITE_REG(hw, E1000_TRGTTIML1, ts.tv_nsec);
6164  E1000_WRITE_REG(hw, E1000_TRGTTIMH1, (u32)ts.tv_sec);
6165  tsauxc = E1000_READ_REG(hw, E1000_TSAUXC);
6166  tsauxc |= TSAUXC_EN_TT1;
6167  E1000_WRITE_REG(hw, E1000_TSAUXC, tsauxc);
6168  adapter->perout[1].start = ts;
6169  spin_unlock(&adapter->tmreg_lock);
6170  ack |= TSINTR_TT1;
6171  }
6172 
6173  if (tsicr & TSINTR_AUTT0) {
6174  nsec = E1000_READ_REG(hw, E1000_AUXSTMPL0);
6175  sec = E1000_READ_REG(hw, E1000_AUXSTMPH0);
6176  event.type = PTP_CLOCK_EXTTS;
6177  event.index = 0;
6178  event.timestamp = sec * 1000000000ULL + nsec;
6179  ptp_clock_event(adapter->ptp_clock, &event);
6180  ack |= TSINTR_AUTT0;
6181  }
6182 
6183  if (tsicr & TSINTR_AUTT1) {
6184  nsec = E1000_READ_REG(hw, E1000_AUXSTMPL1);
6185  sec = E1000_READ_REG(hw, E1000_AUXSTMPH1);
6186  event.type = PTP_CLOCK_EXTTS;
6187  event.index = 1;
6188  event.timestamp = sec * 1000000000ULL + nsec;
6189  ptp_clock_event(adapter->ptp_clock, &event);
6190  ack |= TSINTR_AUTT1;
6191  }
6192 
6193  /* acknowledge the interrupts */
6194  E1000_WRITE_REG(hw, E1000_TSICR, ack);
6195 }
#define E1000_TRGTTIMH0
Definition: e1000_regs.h:534
#define E1000_TRGTTIML1
Definition: e1000_regs.h:535
struct e1000_hw hw
Definition: igb.h:594
#define E1000_TSICR
Definition: e1000_regs.h:544
struct pci_dev * pdev
Definition: igb.h:582
#define E1000_AUXSTMPL0
Definition: e1000_regs.h:539
#define E1000_TSICR_TXTS
#define E1000_AUXSTMPH0
Definition: e1000_regs.h:540
#define E1000_TSAUXC
Definition: e1000_regs.h:532
#define TSINTR_SYS_WRAP
#define E1000_TRGTTIMH1
Definition: e1000_regs.h:536
#define TSINTR_TT1
#define TSAUXC_EN_TT1
#define E1000_TRGTTIML0
Definition: e1000_regs.h:533
#define TSINTR_TT0
#define E1000_AUXSTMPL1
Definition: e1000_regs.h:541
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define TSINTR_AUTT1
#define TSINTR_AUTT0
#define TSAUXC_EN_TT0
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
#define E1000_AUXSTMPH1
Definition: e1000_regs.h:542

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static u32 igb_tx_cmd_type ( struct sk_buff *  skb,
u32  tx_flags 
)
static

igb_main.c 파일의 5438 번째 라인에서 정의되었습니다.

5439 {
5440  /* set type for advanced descriptor with frame checksum insertion */
5441  u32 cmd_type = E1000_ADVTXD_DTYP_DATA |
5444 
5445  /* set HW vlan bit if vlan is present */
5446  cmd_type |= IGB_SET_FLAG(tx_flags, IGB_TX_FLAGS_VLAN,
5448 
5449  /* set segmentation bits for TSO */
5450  cmd_type |= IGB_SET_FLAG(tx_flags, IGB_TX_FLAGS_TSO,
5452 
5453  /* set timestamp bit if present */
5454  cmd_type |= IGB_SET_FLAG(tx_flags, IGB_TX_FLAGS_TSTAMP,
5456 
5457  return cmd_type;
5458 }
#define E1000_ADVTXD_DCMD_IFCS
Definition: e1000_82575.h:287
#define E1000_ADVTXD_MAC_TSTAMP
Definition: e1000_82575.h:294
#define E1000_ADVTXD_DTYP_DATA
Definition: e1000_82575.h:285
#define E1000_ADVTXD_DCMD_VLE
Definition: e1000_82575.h:291
#define E1000_ADVTXD_DCMD_TSE
Definition: e1000_82575.h:292
#define E1000_ADVTXD_DCMD_DEXT
Definition: e1000_82575.h:290
u_int32_t u32
Definition: e1000_osdep.h:50
#define IGB_SET_FLAG(_input, _flag, _result)
Definition: igb_main.c:5433

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_tx_csum ( struct igb_ring tx_ring,
struct igb_tx_buffer first 
)
static

igb_main.c 파일의 5363 번째 라인에서 정의되었습니다.

5364 {
5365  struct sk_buff *skb = first->skb;
5366  u32 vlan_macip_lens = 0;
5367  u32 mss_l4len_idx = 0;
5368  u32 type_tucmd = 0;
5369 
5370  if (skb->ip_summed != CHECKSUM_PARTIAL) {
5371  if (!(first->tx_flags & IGB_TX_FLAGS_VLAN))
5372  return;
5373  } else {
5374  u8 nexthdr = 0;
5375 
5376  switch (first->protocol) {
5377  case __constant_htons(ETH_P_IP):
5378  vlan_macip_lens |= skb_network_header_len(skb);
5379  type_tucmd |= E1000_ADVTXD_TUCMD_IPV4;
5380  nexthdr = ip_hdr(skb)->protocol;
5381  break;
5382 #ifdef NETIF_F_IPV6_CSUM
5383  case __constant_htons(ETH_P_IPV6):
5384  vlan_macip_lens |= skb_network_header_len(skb);
5385  nexthdr = ipv6_hdr(skb)->nexthdr;
5386  break;
5387 #endif
5388  default:
5389  if (unlikely(net_ratelimit())) {
5390  dev_warn(tx_ring->dev,
5391  "partial checksum but proto=%x!\n",
5392  first->protocol);
5393  }
5394  break;
5395  }
5396 
5397  switch (nexthdr) {
5398  case IPPROTO_TCP:
5399  type_tucmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
5400  mss_l4len_idx = tcp_hdrlen(skb) <<
5402  break;
5403 #ifdef HAVE_SCTP
5404  case IPPROTO_SCTP:
5405  type_tucmd |= E1000_ADVTXD_TUCMD_L4T_SCTP;
5406  mss_l4len_idx = sizeof(struct sctphdr) <<
5408  break;
5409 #endif
5410  case IPPROTO_UDP:
5411  mss_l4len_idx = sizeof(struct udphdr) <<
5412  E1000_ADVTXD_L4LEN_SHIFT;
5413  break;
5414  default:
5415  if (unlikely(net_ratelimit())) {
5416  dev_warn(tx_ring->dev,
5417  "partial checksum but l4 proto=%x!\n",
5418  nexthdr);
5419  }
5420  break;
5421  }
5422 
5423  /* update TX checksum flag */
5424  first->tx_flags |= IGB_TX_FLAGS_CSUM;
5425  }
5426 
5427  vlan_macip_lens |= skb_network_offset(skb) << E1000_ADVTXD_MACLEN_SHIFT;
5428  vlan_macip_lens |= first->tx_flags & IGB_TX_FLAGS_VLAN_MASK;
5429 
5430  igb_tx_ctxtdesc(tx_ring, vlan_macip_lens, type_tucmd, mss_l4len_idx);
5431 }
struct device * dev
Definition: igb.h:368
#define E1000_ADVTXD_TUCMD_L4T_SCTP
Definition: e1000_82575.h:319
struct sk_buff * skb
Definition: igb.h:310
__be16 protocol
Definition: igb.h:313
u32 tx_flags
Definition: igb.h:317
#define CHECKSUM_PARTIAL
Definition: kcompat.h:241
#define E1000_ADVTXD_TUCMD_IPV4
Definition: e1000_82575.h:315
#define E1000_ADVTXD_TUCMD_L4T_TCP
Definition: e1000_82575.h:318
u_int8_t u8
Definition: e1000_osdep.h:52
void igb_tx_ctxtdesc(struct igb_ring *tx_ring, u32 vlan_macip_lens, u32 type_tucmd, u32 mss_l4len_idx)
Definition: igb_main.c:5265
#define E1000_ADVTXD_MACLEN_SHIFT
Definition: e1000_82575.h:313
#define IPPROTO_SCTP
Definition: kcompat.h:233
#define IGB_TX_FLAGS_VLAN_MASK
Definition: igb.h:285
#define unlikely(_x)
Definition: kcompat.h:254
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_ADVTXD_L4LEN_SHIFT
Definition: e1000_82575.h:325

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_tx_ctxtdesc ( struct igb_ring tx_ring,
u32  vlan_macip_lens,
u32  type_tucmd,
u32  mss_l4len_idx 
)

igb_main.c 파일의 5265 번째 라인에서 정의되었습니다.

5267 {
5268  struct e1000_adv_tx_context_desc *context_desc;
5269  u16 i = tx_ring->next_to_use;
5270 
5271  context_desc = IGB_TX_CTXTDESC(tx_ring, i);
5272 
5273  i++;
5274  tx_ring->next_to_use = (i < tx_ring->count) ? i : 0;
5275 
5276  /* set bits to identify this as an advanced context descriptor */
5278 
5279  /* For 82575, context index must be unique per ring. */
5280  if (test_bit(IGB_RING_FLAG_TX_CTX_IDX, &tx_ring->flags))
5281  mss_l4len_idx |= tx_ring->reg_idx << 4;
5282 
5283  context_desc->vlan_macip_lens = cpu_to_le32(vlan_macip_lens);
5284  context_desc->seqnum_seed = 0;
5285  context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd);
5286  context_desc->mss_l4len_idx = cpu_to_le32(mss_l4len_idx);
5287 }
u16 count
Definition: igb.h:379
u8 reg_idx
Definition: igb.h:381
u16 next_to_use
Definition: igb.h:385
u_int16_t u16
Definition: e1000_osdep.h:51
#define IGB_TX_CTXTDESC(R, i)
Definition: igb.h:460
#define E1000_ADVTXD_DTYP_CTXT
Definition: e1000_82575.h:284
unsigned long flags
Definition: igb.h:374
#define E1000_TXD_CMD_DEXT

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_tx_map ( struct igb_ring tx_ring,
struct igb_tx_buffer first,
const u8  hdr_len 
)
static

igb_main.c 파일의 5483 번째 라인에서 정의되었습니다.

5486 {
5487  struct sk_buff *skb = first->skb;
5488  struct igb_tx_buffer *tx_buffer;
5489  union e1000_adv_tx_desc *tx_desc;
5490  struct skb_frag_struct *frag;
5491  dma_addr_t dma;
5492  unsigned int data_len, size;
5493  u32 tx_flags = first->tx_flags;
5494  u32 cmd_type = igb_tx_cmd_type(skb, tx_flags);
5495  u16 i = tx_ring->next_to_use;
5496 
5497  tx_desc = IGB_TX_DESC(tx_ring, i);
5498 
5499  igb_tx_olinfo_status(tx_ring, tx_desc, tx_flags, skb->len - hdr_len);
5500 
5501  size = skb_headlen(skb);
5502  data_len = skb->data_len;
5503 
5504  dma = dma_map_single(tx_ring->dev, skb->data, size, DMA_TO_DEVICE);
5505 
5506  tx_buffer = first;
5507 
5508  for (frag = &skb_shinfo(skb)->frags[0];; frag++) {
5509  if (dma_mapping_error(tx_ring->dev, dma))
5510  goto dma_error;
5511 
5512  /* record length, and DMA address */
5513  dma_unmap_len_set(tx_buffer, len, size);
5514  dma_unmap_addr_set(tx_buffer, dma, dma);
5515 
5516  tx_desc->read.buffer_addr = cpu_to_le64(dma);
5517 
5518  while (unlikely(size > IGB_MAX_DATA_PER_TXD)) {
5519  tx_desc->read.cmd_type_len =
5520  cpu_to_le32(cmd_type ^ IGB_MAX_DATA_PER_TXD);
5521 
5522  i++;
5523  tx_desc++;
5524  if (i == tx_ring->count) {
5525  tx_desc = IGB_TX_DESC(tx_ring, 0);
5526  i = 0;
5527  }
5528  tx_desc->read.olinfo_status = 0;
5529 
5530  dma += IGB_MAX_DATA_PER_TXD;
5531  size -= IGB_MAX_DATA_PER_TXD;
5532 
5533  tx_desc->read.buffer_addr = cpu_to_le64(dma);
5534  }
5535 
5536  if (likely(!data_len))
5537  break;
5538 
5539  tx_desc->read.cmd_type_len = cpu_to_le32(cmd_type ^ size);
5540 
5541  i++;
5542  tx_desc++;
5543  if (i == tx_ring->count) {
5544  tx_desc = IGB_TX_DESC(tx_ring, 0);
5545  i = 0;
5546  }
5547  tx_desc->read.olinfo_status = 0;
5548 
5549  size = skb_frag_size(frag);
5550  data_len -= size;
5551 
5552  dma = skb_frag_dma_map(tx_ring->dev, frag, 0,
5553  size, DMA_TO_DEVICE);
5554 
5555  tx_buffer = &tx_ring->tx_buffer_info[i];
5556  }
5557 
5558  /* write last descriptor with RS and EOP bits */
5559  cmd_type |= size | IGB_TXD_DCMD;
5560  tx_desc->read.cmd_type_len = cpu_to_le32(cmd_type);
5561 
5562  netdev_tx_sent_queue(txring_txq(tx_ring), first->bytecount);
5563  /* set the timestamp */
5564  first->time_stamp = jiffies;
5565 
5566  /*
5567  * Force memory writes to complete before letting h/w know there
5568  * are new descriptors to fetch. (Only applicable for weak-ordered
5569  * memory model archs, such as IA-64).
5570  *
5571  * We also need this memory barrier to make certain all of the
5572  * status bits have been updated before next_to_watch is written.
5573  */
5574  wmb();
5575 
5576  /* set next_to_watch value indicating a packet is present */
5577  first->next_to_watch = tx_desc;
5578 
5579  i++;
5580  if (i == tx_ring->count)
5581  i = 0;
5582 
5583  tx_ring->next_to_use = i;
5584 
5585  writel(i, tx_ring->tail);
5586 
5587  /* we need this if more than one processor can write to our tail
5588  * at a time, it syncronizes IO on IA64/Altix systems
5589  */
5590  mmiowb();
5591 
5592  return;
5593 
5594 dma_error:
5595  dev_err(tx_ring->dev, "TX DMA map failed\n");
5596 
5597  /* clear dma mappings for failed tx_buffer_info map */
5598  for (;;) {
5599  tx_buffer = &tx_ring->tx_buffer_info[i];
5600  igb_unmap_and_free_tx_resource(tx_ring, tx_buffer);
5601  if (tx_buffer == first)
5602  break;
5603  if (i == 0)
5604  i = tx_ring->count;
5605  i--;
5606  }
5607 
5608  tx_ring->next_to_use = i;
5609 }
u16 count
Definition: igb.h:379
struct device * dev
Definition: igb.h:368
struct sk_buff * skb
Definition: igb.h:310
struct e1000_adv_tx_desc::@36 read
#define IGB_TXD_DCMD
Definition: igb.h:454
#define IGB_MAX_DATA_PER_TXD
Definition: igb.h:293
#define IGB_TX_DESC(R, i)
Definition: igb.h:458
u16 next_to_use
Definition: igb.h:385
#define mmiowb()
Definition: kcompat.h:182
u_int16_t u16
Definition: e1000_osdep.h:51
unsigned long time_stamp
Definition: igb.h:309
#define likely(_x)
Definition: kcompat.h:255
unsigned int bytecount
Definition: igb.h:311
u32 tx_flags
Definition: igb.h:317
void __iomem * tail
Definition: igb.h:375
static u32 igb_tx_cmd_type(struct sk_buff *skb, u32 tx_flags)
Definition: igb_main.c:5438
int size
union e1000_adv_tx_desc * next_to_watch
Definition: igb.h:308
struct igb_tx_buffer * tx_buffer_info
Definition: igb.h:370
static void igb_tx_olinfo_status(struct igb_ring *tx_ring, union e1000_adv_tx_desc *tx_desc, u32 tx_flags, unsigned int paylen)
Definition: igb_main.c:5460
#define wmb()
Definition: e1000_osdep.h:64
#define unlikely(_x)
Definition: kcompat.h:254
u_int32_t u32
Definition: e1000_osdep.h:50
void igb_unmap_and_free_tx_resource(struct igb_ring *ring, struct igb_tx_buffer *tx_buffer)
Definition: igb_main.c:4172

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_tx_olinfo_status ( struct igb_ring tx_ring,
union e1000_adv_tx_desc tx_desc,
u32  tx_flags,
unsigned int  paylen 
)
static

igb_main.c 파일의 5460 번째 라인에서 정의되었습니다.

5463 {
5464  u32 olinfo_status = paylen << E1000_ADVTXD_PAYLEN_SHIFT;
5465 
5466  /* 82575 requires a unique index per ring */
5467  if (test_bit(IGB_RING_FLAG_TX_CTX_IDX, &tx_ring->flags))
5468  olinfo_status |= tx_ring->reg_idx << 4;
5469 
5470  /* insert L4 checksum */
5471  olinfo_status |= IGB_SET_FLAG(tx_flags,
5473  (E1000_TXD_POPTS_TXSM << 8));
5474 
5475  /* insert IPv4 checksum */
5476  olinfo_status |= IGB_SET_FLAG(tx_flags,
5478  (E1000_TXD_POPTS_IXSM << 8));
5479 
5480  tx_desc->read.olinfo_status = cpu_to_le32(olinfo_status);
5481 }
u8 reg_idx
Definition: igb.h:381
#define E1000_TXD_POPTS_IXSM
#define E1000_ADVTXD_PAYLEN_SHIFT
Definition: e1000_82575.h:303
struct e1000_adv_tx_desc::@36 read
#define E1000_TXD_POPTS_TXSM
unsigned long flags
Definition: igb.h:374
u_int32_t u32
Definition: e1000_osdep.h:50
#define IGB_SET_FLAG(_input, _flag, _result)
Definition: igb_main.c:5433

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static struct igb_ring* igb_tx_queue_mapping ( struct igb_adapter adapter,
struct sk_buff *  skb 
)
static

igb_main.c 파일의 5745 번째 라인에서 정의되었습니다.

5747 {
5748  unsigned int r_idx = skb->queue_mapping;
5749 
5750  if (r_idx >= adapter->num_tx_queues)
5751  r_idx = r_idx % adapter->num_tx_queues;
5752 
5753  return adapter->tx_ring[r_idx];
5754 }
int num_tx_queues
Definition: igb.h:547
struct igb_ring * tx_ring[IGB_MAX_TX_QUEUES]
Definition: igb.h:548

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_tx_timeout ( struct net_device *  netdev)
static

igb_tx_timeout - Respond to a Tx Hang : network interface device structure

igb_main.c 파일의 5802 번째 라인에서 정의되었습니다.

5803 {
5804  struct igb_adapter *adapter = netdev_priv(netdev);
5805  struct e1000_hw *hw = &adapter->hw;
5806 
5807  /* Do the reset outside of interrupt context */
5808  adapter->tx_timeout_count++;
5809 
5810  if (hw->mac.type >= e1000_82580)
5811  hw->dev_spec._82575.global_device_reset = true;
5812 
5813  schedule_work(&adapter->reset_task);
5815  (adapter->eims_enable_mask & ~adapter->eims_other));
5816 }
u32 tx_timeout_count
Definition: igb.h:546
struct e1000_hw hw
Definition: igb.h:594
#define E1000_EICS
Definition: e1000_regs.h:67
struct net_device * netdev
Definition: igb.h:535
union e1000_hw::@65 dev_spec
struct work_struct reset_task
Definition: igb.h:569
u32 eims_other
Definition: igb.h:609
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
u32 eims_enable_mask
Definition: igb.h:608
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
struct e1000_dev_spec_82575 _82575
Definition: e1000_hw.h:771

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static u32 igb_tx_wthresh ( struct igb_adapter adapter)
static

igb_main.c 파일의 3580 번째 라인에서 정의되었습니다.

3581 {
3582  struct e1000_hw *hw = &adapter->hw;
3583 
3584  switch (hw->mac.type) {
3585  case e1000_i354:
3586  return 4;
3587  case e1000_82576:
3588  if (adapter->msix_entries)
3589  return 1;
3590  default:
3591  break;
3592  }
3593 
3594  return 16;
3595 }
struct msix_entry * msix_entries
Definition: igb.h:541
struct e1000_hw hw
Definition: igb.h:594
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_unbind ( struct file *  file)
static

igb_main.c 파일의 10312 번째 라인에서 정의되었습니다.

10313 {
10314  struct igb_adapter *adapter;
10315  struct igb_private_data *igb_priv = file->private_data;
10316 
10317  if (igb_priv == NULL) {
10318  printk("cannot find private data!\n");
10319  return -ENOENT;
10320  }
10321 
10322  adapter = igb_priv->adapter;
10323  if (adapter == NULL)
10324  return -EBADFD;
10325 
10326  igb_priv->adapter = NULL;
10327  return 0;
10328 }
struct igb_adapter * adapter
Definition: igb.h:929
#define NULL
Null pointer value.

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_unmap_and_free_tx_resource ( struct igb_ring ring,
struct igb_tx_buffer tx_buffer 
)

igb_main.c 파일의 4172 번째 라인에서 정의되었습니다.

4174 {
4175  if (tx_buffer->skb) {
4176  dev_kfree_skb_any(tx_buffer->skb);
4177  if (dma_unmap_len(tx_buffer, len))
4178  dma_unmap_single(ring->dev,
4179  dma_unmap_addr(tx_buffer, dma),
4180  dma_unmap_len(tx_buffer, len),
4181  DMA_TO_DEVICE);
4182  } else if (dma_unmap_len(tx_buffer, len)) {
4183  dma_unmap_page(ring->dev,
4184  dma_unmap_addr(tx_buffer, dma),
4185  dma_unmap_len(tx_buffer, len),
4186  DMA_TO_DEVICE);
4187  }
4188  tx_buffer->next_to_watch = NULL;
4189  tx_buffer->skb = NULL;
4190  dma_unmap_len_set(tx_buffer, len, 0);
4191  /* buffer_info must be completely set up in the transmit path */
4192 }
struct device * dev
Definition: igb.h:368
struct sk_buff * skb
Definition: igb.h:310
union e1000_adv_tx_desc * next_to_watch
Definition: igb.h:308
#define NULL
Null pointer value.

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static long igb_unmapbuf ( struct file *  file,
void __user *  arg,
int  ring 
)
static

igb_main.c 파일의 10603 번째 라인에서 정의되었습니다.

10604 {
10605  int err = 0;
10606  struct igb_private_data *igb_priv = file->private_data;
10607  struct igb_adapter *adapter;
10608  struct igb_buf_cmd req;
10609  int buf_cmd_size = 0;
10610 
10611  if (igb_priv == NULL) {
10612  printk("cannot find private data!\n");
10613  return -ENOENT;
10614  }
10615 
10616  adapter = igb_priv->adapter;
10617  if (adapter == NULL) {
10618  printk("map to unbound device!\n");
10619  return -ENOENT;
10620  }
10621 
10622 
10623  if((ring != IGB_IOCTL_UNMAPBUF) && (ring != IGB_IOCTL_UNMAP_TX_RING) &&
10624  (ring != IGB_IOCTL_UNMAP_RX_RING)) {
10625 
10626  dev_warn(&adapter->pdev->dev, "Old ioctl number used: %d, consider using new one from libigb \n", ring);
10627  buf_cmd_size = sizeof(req) - sizeof(u64);
10628 
10629  } else {
10630 
10631  buf_cmd_size = sizeof(req);
10632  }
10633 
10634  if (copy_from_user(&req, arg, buf_cmd_size))
10635  return -EFAULT;
10636 
10637 
10638  if ((ring == IGB_UNMAP_TX_RING) || (ring == IGB_IOCTL_UNMAP_TX_RING)) {
10639  /* its easy to figure out what to free on the rings ... */
10640  if (req.queue >= 3)
10641  return -EINVAL;
10642 
10643  mutex_lock(&adapter->lock);
10644  if (0 == (igb_priv->uring_tx_init & (1 << req.queue))) {
10645  mutex_unlock(&adapter->lock);
10646  return -EINVAL;
10647  } else {
10648  if (0 == (adapter->uring_tx_init & (1 << req.queue))) {
10649  printk("Warning: invalid tx ring buffer state!\n");
10650  }
10651  }
10652 
10653  adapter->uring_tx_init &= ~(1 << req.queue);
10654  igb_priv->uring_tx_init &= ~(1 << req.queue);
10655  mutex_unlock(&adapter->lock);
10656  } else if ((ring == IGB_UNMAP_RX_RING) || (ring == IGB_IOCTL_UNMAP_RX_RING)) {
10657  /* its easy to figure out what to free on the rings ... */
10658  if (req.queue >= 3)
10659  return -EINVAL;
10660 
10661  mutex_lock(&adapter->lock);
10662  if (0 == (igb_priv->uring_rx_init & (1 << req.queue))) {
10663  mutex_unlock(&adapter->lock);
10664  return -EINVAL;
10665  } else {
10666  if (0 == (adapter->uring_rx_init & (1 << req.queue))) {
10667  printk("Warning: invalid rx ring buffer state!\n");
10668  }
10669  }
10670 
10671  adapter->uring_rx_init &= ~(1 << req.queue);
10672  igb_priv->uring_rx_init &= ~(1 << req.queue);
10673  mutex_unlock(&adapter->lock);
10674  } else {
10675  /* have to find the corresponding page to free */
10676  struct igb_user_page *userpage;
10677 
10678  mutex_lock(&adapter->lock);
10679  userpage = igb_priv->userpages;
10680 
10681  while (userpage != NULL) {
10682  if (req.physaddr == userpage->page_dma)
10683  break;
10684  userpage = userpage->next;
10685  }
10686 
10687  if (userpage == NULL) {
10688  mutex_unlock(&adapter->lock);
10689  return -EINVAL;
10690  }
10691 
10692  dma_unmap_page(pci_dev_to_dev(adapter->pdev),
10693  userpage->page_dma,
10694  PAGE_SIZE,
10695  DMA_FROM_DEVICE);
10696 
10697  put_page(userpage->page);
10698 
10699  /* take the page out of our list and free it */
10700  if (userpage->prev)
10701  userpage->prev->next = userpage->next;
10702 
10703  if (userpage->next)
10704  userpage->next->prev = userpage->prev;
10705 
10706  if (userpage == igb_priv->userpages)
10707  igb_priv->userpages = userpage->next;
10708 
10709  vfree(userpage);
10710  mutex_unlock(&adapter->lock);
10711  }
10712  return err;
10713 }
struct igb_adapter * adapter
Definition: igb.h:929
int err
struct mutex lock
Definition: igb.h:693
dma_addr_t page_dma
Definition: igb.h:52
struct pci_dev * pdev
Definition: igb.h:582
u32 uring_rx_init
Definition: igb.h:934
u32 uring_tx_init
Definition: igb.h:584
u32 uring_tx_init
Definition: igb.h:933
u32 uring_rx_init
Definition: igb.h:585
struct page * page
Definition: igb.h:51
struct igb_user_page * next
Definition: igb.h:50
#define IGB_IOCTL_UNMAP_TX_RING
Definition: igb.h:893
static struct device * pci_dev_to_dev(struct pci_dev *pdev)
Definition: kcompat.h:1361
#define IGB_UNMAP_TX_RING
Definition: igb.h:879
#define IGB_IOCTL_UNMAP_RX_RING
Definition: igb.h:897
struct igb_user_page * userpages
Definition: igb.h:931
struct igb_user_page * prev
Definition: igb.h:49
#define IGB_IOCTL_UNMAPBUF
Definition: igb.h:895
u_int64_t u64
Definition: e1000_osdep.h:49
#define NULL
Null pointer value.
#define IGB_UNMAP_RX_RING
Definition: igb.h:884

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_up ( struct igb_adapter adapter)

igb_up - Open the interface and prepare it to handle traffic : board private structure

igb_main.c 파일의 1829 번째 라인에서 정의되었습니다.

1830 {
1831  struct e1000_hw *hw = &adapter->hw;
1832  int i;
1833 
1834  /* hardware has been reset, we need to reload some things */
1835  igb_configure(adapter);
1836 
1837  clear_bit(__IGB_DOWN, &adapter->state);
1838 
1839  for (i = 0; i < adapter->num_q_vectors; i++)
1840  napi_enable(&(adapter->q_vector[i]->napi));
1841 
1842  if (adapter->msix_entries)
1843  igb_configure_msix(adapter);
1844  else
1845  igb_assign_vector(adapter->q_vector[0], 0);
1846 
1847  igb_configure_lli(adapter);
1848 
1849  /* Clear any pending interrupts. */
1851  igb_irq_enable(adapter);
1852 
1853  /* notify VFs that reset has been completed */
1854  if (adapter->vfs_allocated_count) {
1855  u32 reg_data = E1000_READ_REG(hw, E1000_CTRL_EXT);
1856 
1857  reg_data |= E1000_CTRL_EXT_PFRSTD;
1858  E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg_data);
1859  }
1860 
1861  netif_tx_start_all_queues(adapter->netdev);
1862 
1863  if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA)
1864  schedule_work(&adapter->dma_err_task);
1865  /* start the watchdog. */
1866  hw->mac.get_link_status = 1;
1867  schedule_work(&adapter->watchdog_task);
1868 
1869  if ((adapter->flags & IGB_FLAG_EEE) &&
1870  (!hw->dev_spec._82575.eee_disable))
1871  adapter->eee_advert = MDIO_EEE_100TX | MDIO_EEE_1000T;
1872 
1873 }
unsigned int num_q_vectors
Definition: igb.h:540
struct msix_entry * msix_entries
Definition: igb.h:541
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
u16 eee_advert
Definition: igb.h:688
#define E1000_ICR
Definition: e1000_regs.h:55
#define E1000_CTRL_EXT
Definition: e1000_regs.h:32
struct net_device * netdev
Definition: igb.h:535
union e1000_hw::@65 dev_spec
unsigned int flags
Definition: igb.h:538
static void igb_assign_vector(struct igb_q_vector *q_vector, int msix_vector)
Definition: igb_main.c:555
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define IGB_FLAG_EEE
Definition: igb.h:717
struct work_struct watchdog_task
Definition: igb.h:570
#define E1000_CTRL_EXT_PFRSTD
Definition: e1000_defines.h:69
unsigned long state
Definition: igb.h:537
struct igb_q_vector * q_vector[MAX_Q_VECTORS]
Definition: igb.h:607
static void igb_configure_msix(struct igb_adapter *adapter)
Definition: igb_main.c:641
bool get_link_status
Definition: e1000_hw.h:633
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
struct work_struct dma_err_task
Definition: igb.h:571
u_int32_t u32
Definition: e1000_osdep.h:50
struct napi_struct napi
Definition: igb.h:421
#define IGB_FLAG_DETECT_BAD_DMA
Definition: igb.h:719
static void igb_configure(struct igb_adapter *)
Definition: igb_main.c:1579
struct e1000_dev_spec_82575 _82575
Definition: e1000_hw.h:771
static void igb_configure_lli(struct igb_adapter *adapter)
Definition: igb_main.c:492
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
static void igb_irq_enable(struct igb_adapter *adapter)
Definition: igb_main.c:1478

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_update_itr ( struct igb_q_vector q_vector,
struct igb_ring_container ring_container 
)
static

igb_update_itr - update the dynamic ITR value based on statistics Stores a new ITR value based on packets and byte counts during the last interrupt. The advantage of per interrupt computation is faster updates and more accurate ITR for the current traffic pattern. Constants in this function were computed based on theoretical maximum wire speed and thresholds were set based on testing data as well as attempting to minimize response time while increasing bulk throughput. this functionality is controlled by the InterruptThrottleRate module parameter (see igb_param.c) NOTE: These calculations are only valid when operating in a single- queue environment. : pointer to q_vector : ring info to update the itr for

igb_main.c 파일의 5149 번째 라인에서 정의되었습니다.

5151 {
5152  unsigned int packets = ring_container->total_packets;
5153  unsigned int bytes = ring_container->total_bytes;
5154  u8 itrval = ring_container->itr;
5155 
5156  /* no packets, exit with status unchanged */
5157  if (packets == 0)
5158  return;
5159 
5160  switch (itrval) {
5161  case lowest_latency:
5162  /* handle TSO and jumbo frames */
5163  if (bytes/packets > 8000)
5164  itrval = bulk_latency;
5165  else if ((packets < 5) && (bytes > 512))
5166  itrval = low_latency;
5167  break;
5168  case low_latency: /* 50 usec aka 20000 ints/s */
5169  if (bytes > 10000) {
5170  /* this if handles the TSO accounting */
5171  if (bytes/packets > 8000)
5172  itrval = bulk_latency;
5173  else if ((packets < 10) || ((bytes/packets) > 1200))
5174  itrval = bulk_latency;
5175  else if ((packets > 35))
5176  itrval = lowest_latency;
5177  } else if (bytes/packets > 2000) {
5178  itrval = bulk_latency;
5179  } else if (packets <= 2 && bytes < 512) {
5180  itrval = lowest_latency;
5181  }
5182  break;
5183  case bulk_latency: /* 250 usec aka 4000 ints/s */
5184  if (bytes > 25000) {
5185  if (packets > 35)
5186  itrval = low_latency;
5187  } else if (bytes < 1500) {
5188  itrval = low_latency;
5189  }
5190  break;
5191  }
5192 
5193  /* clear work counters since we have the values we need */
5194  ring_container->total_bytes = 0;
5195  ring_container->total_packets = 0;
5196 
5197  /* write updated itr to ring container */
5198  ring_container->itr = itrval;
5199 }
unsigned int total_packets
Definition: igb.h:359
u_int8_t u8
Definition: e1000_osdep.h:52
unsigned int total_bytes
Definition: igb.h:358

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_update_mng_vlan ( struct igb_adapter adapter)
static

igb_main.c 파일의 1509 번째 라인에서 정의되었습니다.

1510 {
1511  struct e1000_hw *hw = &adapter->hw;
1512  u16 vid = adapter->hw.mng_cookie.vlan_id;
1513  u16 old_vid = adapter->mng_vlan_id;
1514 
1516  /* add VID to filter table */
1517  igb_vfta_set(adapter, vid, TRUE);
1518  adapter->mng_vlan_id = vid;
1519  } else {
1520  adapter->mng_vlan_id = IGB_MNG_VLAN_NONE;
1521  }
1522 
1523  if ((old_vid != (u16)IGB_MNG_VLAN_NONE) &&
1524  (vid != old_vid) &&
1525 #ifdef HAVE_VLAN_RX_REGISTER
1526  !vlan_group_get_device(adapter->vlgrp, old_vid)) {
1527 #else
1528  !test_bit(old_vid, adapter->active_vlans)) {
1529 #endif
1530  /* remove VID from filter table */
1531  igb_vfta_set(adapter, old_vid, FALSE);
1532  }
1533 }
struct e1000_hw hw
Definition: igb.h:594
u16 mng_vlan_id
Definition: igb.h:557
#define IGB_MNG_VLAN_NONE
Definition: igb.h:222
u_int16_t u16
Definition: e1000_osdep.h:51
#define FALSE
Definition: maap_log.h:94
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]
Definition: igb.h:533
struct e1000_host_mng_dhcp_cookie mng_cookie
Definition: e1000_hw.h:768
#define TRUE
Definition: maap_log.h:91
#define E1000_MNG_DHCP_COOKIE_STATUS_VLAN
Definition: e1000_manage.h:63
static void igb_vfta_set(struct igb_adapter *adapter, u32 vid, bool add)
Definition: igb_main.c:350

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_update_phy_info ( struct timer_list *  timer)
static

igb_main.c 파일의 4700 번째 라인에서 정의되었습니다.

4704 {
4705  struct igb_adapter *adapter;
4706 
4707 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
4708  adapter = container_of(timer, struct igb_adapter, watchdog_timer);
4709 #else
4710  adapter = (struct igb_adapter *) data;
4711 #endif
4712 
4713  e1000_get_phy_info(&adapter->hw);
4714 }
struct e1000_hw hw
Definition: igb.h:594
struct timer_list watchdog_timer
Definition: igb.h:554
s32 e1000_get_phy_info(struct e1000_hw *hw)
Definition: e1000_api.c:857

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_update_ring_itr ( struct igb_q_vector q_vector)
static

igb_update_ring_itr - update the dynamic ITR value based on packet size

 Stores a new ITR value based on strictly on packet size.  This
 algorithm is less sophisticated than that used in igb_update_itr,
 due to the difficulty of synchronizing statistics across multiple
 receive rings.  The divisors and thresholds used by this function
 were determined based on theoretical maximum wire speed and testing
 data, in order to minimize response time while increasing bulk
 throughput.
 This functionality is controlled by the InterruptThrottleRate module
 parameter (see igb_param.c)
 NOTE:  This function is called only when operating in a multiqueue
        receive environment.

: pointer to q_vector

igb_main.c 파일의 5071 번째 라인에서 정의되었습니다.

5072 {
5073  int new_val = q_vector->itr_val;
5074  int avg_wire_size = 0;
5075  struct igb_adapter *adapter = q_vector->adapter;
5076  unsigned int packets;
5077 
5078  /* For non-gigabit speeds, just fix the interrupt rate at 4000
5079  * ints/sec - ITR timer value of 120 ticks.
5080  */
5081  switch (adapter->link_speed) {
5082  case SPEED_10:
5083  case SPEED_100:
5084  new_val = IGB_4K_ITR;
5085  goto set_itr_val;
5086  default:
5087  break;
5088  }
5089 
5090  packets = q_vector->rx.total_packets;
5091  if (packets)
5092  avg_wire_size = q_vector->rx.total_bytes / packets;
5093 
5094  packets = q_vector->tx.total_packets;
5095  if (packets)
5096  avg_wire_size = max_t(u32, avg_wire_size,
5097  q_vector->tx.total_bytes / packets);
5098 
5099  /* if avg_wire_size isn't set no work was done */
5100  if (!avg_wire_size)
5101  goto clear_counts;
5102 
5103  /* Add 24 bytes to size to account for CRC, preamble, and gap */
5104  avg_wire_size += 24;
5105 
5106  /* Don't starve jumbo frames */
5107  avg_wire_size = min(avg_wire_size, 3000);
5108 
5109  /* Give a little boost to mid-size frames */
5110  if ((avg_wire_size > 300) && (avg_wire_size < 1200))
5111  new_val = avg_wire_size / 3;
5112  else
5113  new_val = avg_wire_size / 2;
5114 
5115  /* conservative mode (itr 3) eliminates the lowest_latency setting */
5116  if (new_val < IGB_20K_ITR &&
5117  ((q_vector->rx.ring && adapter->rx_itr_setting == 3) ||
5118  (!q_vector->rx.ring && adapter->tx_itr_setting == 3)))
5119  new_val = IGB_20K_ITR;
5120 
5121 set_itr_val:
5122  if (new_val != q_vector->itr_val) {
5123  q_vector->itr_val = new_val;
5124  q_vector->set_itr = 1;
5125  }
5126 clear_counts:
5127  q_vector->rx.total_bytes = 0;
5128  q_vector->rx.total_packets = 0;
5129  q_vector->tx.total_bytes = 0;
5130  q_vector->tx.total_packets = 0;
5131 }
#define IGB_4K_ITR
Definition: igb.h:100
u8 set_itr
Definition: igb.h:416
unsigned int total_packets
Definition: igb.h:359
struct igb_adapter * adapter
Definition: igb.h:411
#define IGB_20K_ITR
Definition: igb.h:101
struct igb_ring_container rx tx
Definition: igb.h:419
u32 rx_itr_setting
Definition: igb.h:566
u16 itr_val
Definition: igb.h:415
u32 tx_itr_setting
Definition: igb.h:567
#define SPEED_100
u16 link_speed
Definition: igb.h:561
u_int32_t u32
Definition: e1000_osdep.h:50
#define SPEED_10
unsigned int total_bytes
Definition: igb.h:358

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_update_stats ( struct igb_adapter adapter)

igb_update_stats - Update the board statistics counters : board private structure

igb_main.c 파일의 5908 번째 라인에서 정의되었습니다.

5909 {
5910 #ifdef HAVE_NETDEV_STATS_IN_NETDEV
5911  struct net_device_stats *net_stats = &adapter->netdev->stats;
5912 #else
5913  struct net_device_stats *net_stats = &adapter->net_stats;
5914 #endif /* HAVE_NETDEV_STATS_IN_NETDEV */
5915  struct e1000_hw *hw = &adapter->hw;
5916 #ifdef HAVE_PCI_ERS
5917  struct pci_dev *pdev = adapter->pdev;
5918 #endif
5919  u32 reg, mpc;
5920  u16 phy_tmp;
5921  int i;
5922  u64 bytes, packets;
5923 #ifndef IGB_NO_LRO
5924  u32 flushed = 0, coal = 0;
5925  struct igb_q_vector *q_vector;
5926 #endif
5927 
5928 #define PHY_IDLE_ERROR_COUNT_MASK 0x00FF
5929 
5930  /*
5931  * Prevent stats update while adapter is being reset, or if the pci
5932  * connection is down.
5933  */
5934  if (adapter->link_speed == 0)
5935  return;
5936 #ifdef HAVE_PCI_ERS
5937  if (pci_channel_offline(pdev))
5938  return;
5939 
5940 #endif
5941 #ifndef IGB_NO_LRO
5942  for (i = 0; i < adapter->num_q_vectors; i++) {
5943  q_vector = adapter->q_vector[i];
5944  if (!q_vector)
5945  continue;
5946  flushed += q_vector->lrolist.stats.flushed;
5947  coal += q_vector->lrolist.stats.coal;
5948  }
5949  adapter->lro_stats.flushed = flushed;
5950  adapter->lro_stats.coal = coal;
5951 
5952 #endif
5953  bytes = 0;
5954  packets = 0;
5955  for (i = 0; i < adapter->num_rx_queues; i++) {
5956  struct igb_ring *ring = adapter->rx_ring[i];
5957  u32 rqdpc_tmp = E1000_READ_REG(hw, E1000_RQDPC(i)) & 0x0FFF;
5958 
5959  if (hw->mac.type >= e1000_i210)
5960  E1000_WRITE_REG(hw, E1000_RQDPC(i), 0);
5961  ring->rx_stats.drops += rqdpc_tmp;
5962  net_stats->rx_fifo_errors += rqdpc_tmp;
5963 #ifdef CONFIG_IGB_VMDQ_NETDEV
5964  if (!ring->vmdq_netdev) {
5965  bytes += ring->rx_stats.bytes;
5966  packets += ring->rx_stats.packets;
5967  }
5968 #else
5969  bytes += ring->rx_stats.bytes;
5970  packets += ring->rx_stats.packets;
5971 #endif
5972  }
5973 
5974  net_stats->rx_bytes = bytes;
5975  net_stats->rx_packets = packets;
5976 
5977  bytes = 0;
5978  packets = 0;
5979  for (i = 0; i < adapter->num_tx_queues; i++) {
5980  struct igb_ring *ring = adapter->tx_ring[i];
5981 #ifdef CONFIG_IGB_VMDQ_NETDEV
5982  if (!ring->vmdq_netdev) {
5983  bytes += ring->tx_stats.bytes;
5984  packets += ring->tx_stats.packets;
5985  }
5986 #else
5987  bytes += ring->tx_stats.bytes;
5988  packets += ring->tx_stats.packets;
5989 #endif
5990  }
5991  net_stats->tx_bytes = bytes;
5992  net_stats->tx_packets = packets;
5993 
5994  /* read stats registers */
5995  adapter->stats.crcerrs += E1000_READ_REG(hw, E1000_CRCERRS);
5996  adapter->stats.gprc += E1000_READ_REG(hw, E1000_GPRC);
5997  adapter->stats.gorc += E1000_READ_REG(hw, E1000_GORCL);
5998  E1000_READ_REG(hw, E1000_GORCH); /* clear GORCL */
5999  adapter->stats.bprc += E1000_READ_REG(hw, E1000_BPRC);
6000  adapter->stats.mprc += E1000_READ_REG(hw, E1000_MPRC);
6001  adapter->stats.roc += E1000_READ_REG(hw, E1000_ROC);
6002 
6003  adapter->stats.prc64 += E1000_READ_REG(hw, E1000_PRC64);
6004  adapter->stats.prc127 += E1000_READ_REG(hw, E1000_PRC127);
6005  adapter->stats.prc255 += E1000_READ_REG(hw, E1000_PRC255);
6006  adapter->stats.prc511 += E1000_READ_REG(hw, E1000_PRC511);
6007  adapter->stats.prc1023 += E1000_READ_REG(hw, E1000_PRC1023);
6008  adapter->stats.prc1522 += E1000_READ_REG(hw, E1000_PRC1522);
6009  adapter->stats.symerrs += E1000_READ_REG(hw, E1000_SYMERRS);
6010  adapter->stats.sec += E1000_READ_REG(hw, E1000_SEC);
6011 
6012  mpc = E1000_READ_REG(hw, E1000_MPC);
6013  adapter->stats.mpc += mpc;
6014  net_stats->rx_fifo_errors += mpc;
6015  adapter->stats.scc += E1000_READ_REG(hw, E1000_SCC);
6016  adapter->stats.ecol += E1000_READ_REG(hw, E1000_ECOL);
6017  adapter->stats.mcc += E1000_READ_REG(hw, E1000_MCC);
6018  adapter->stats.latecol += E1000_READ_REG(hw, E1000_LATECOL);
6019  adapter->stats.dc += E1000_READ_REG(hw, E1000_DC);
6020  adapter->stats.rlec += E1000_READ_REG(hw, E1000_RLEC);
6021  adapter->stats.xonrxc += E1000_READ_REG(hw, E1000_XONRXC);
6022  adapter->stats.xontxc += E1000_READ_REG(hw, E1000_XONTXC);
6023  adapter->stats.xoffrxc += E1000_READ_REG(hw, E1000_XOFFRXC);
6024  adapter->stats.xofftxc += E1000_READ_REG(hw, E1000_XOFFTXC);
6025  adapter->stats.fcruc += E1000_READ_REG(hw, E1000_FCRUC);
6026  adapter->stats.gptc += E1000_READ_REG(hw, E1000_GPTC);
6027  adapter->stats.gotc += E1000_READ_REG(hw, E1000_GOTCL);
6028  E1000_READ_REG(hw, E1000_GOTCH); /* clear GOTCL */
6029  adapter->stats.rnbc += E1000_READ_REG(hw, E1000_RNBC);
6030  adapter->stats.ruc += E1000_READ_REG(hw, E1000_RUC);
6031  adapter->stats.rfc += E1000_READ_REG(hw, E1000_RFC);
6032  adapter->stats.rjc += E1000_READ_REG(hw, E1000_RJC);
6033  adapter->stats.tor += E1000_READ_REG(hw, E1000_TORH);
6034  adapter->stats.tot += E1000_READ_REG(hw, E1000_TOTH);
6035  adapter->stats.tpr += E1000_READ_REG(hw, E1000_TPR);
6036 
6037  adapter->stats.ptc64 += E1000_READ_REG(hw, E1000_PTC64);
6038  adapter->stats.ptc127 += E1000_READ_REG(hw, E1000_PTC127);
6039  adapter->stats.ptc255 += E1000_READ_REG(hw, E1000_PTC255);
6040  adapter->stats.ptc511 += E1000_READ_REG(hw, E1000_PTC511);
6041  adapter->stats.ptc1023 += E1000_READ_REG(hw, E1000_PTC1023);
6042  adapter->stats.ptc1522 += E1000_READ_REG(hw, E1000_PTC1522);
6043 
6044  adapter->stats.mptc += E1000_READ_REG(hw, E1000_MPTC);
6045  adapter->stats.bptc += E1000_READ_REG(hw, E1000_BPTC);
6046 
6047  adapter->stats.tpt += E1000_READ_REG(hw, E1000_TPT);
6048  adapter->stats.colc += E1000_READ_REG(hw, E1000_COLC);
6049 
6050  adapter->stats.algnerrc += E1000_READ_REG(hw, E1000_ALGNERRC);
6051  /* read internal phy sepecific stats */
6052  reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
6053  if (!(reg & E1000_CTRL_EXT_LINK_MODE_MASK)) {
6054  adapter->stats.rxerrc += E1000_READ_REG(hw, E1000_RXERRC);
6055 
6056  /* this stat has invalid values on i210/i211 */
6057  if ((hw->mac.type != e1000_i210) &&
6058  (hw->mac.type != e1000_i211))
6059  adapter->stats.tncrs += E1000_READ_REG(hw, E1000_TNCRS);
6060  }
6061  adapter->stats.tsctc += E1000_READ_REG(hw, E1000_TSCTC);
6062  adapter->stats.tsctfc += E1000_READ_REG(hw, E1000_TSCTFC);
6063 
6064  adapter->stats.iac += E1000_READ_REG(hw, E1000_IAC);
6065  adapter->stats.icrxoc += E1000_READ_REG(hw, E1000_ICRXOC);
6066  adapter->stats.icrxptc += E1000_READ_REG(hw, E1000_ICRXPTC);
6067  adapter->stats.icrxatc += E1000_READ_REG(hw, E1000_ICRXATC);
6068  adapter->stats.ictxptc += E1000_READ_REG(hw, E1000_ICTXPTC);
6069  adapter->stats.ictxatc += E1000_READ_REG(hw, E1000_ICTXATC);
6070  adapter->stats.ictxqec += E1000_READ_REG(hw, E1000_ICTXQEC);
6071  adapter->stats.ictxqmtc += E1000_READ_REG(hw, E1000_ICTXQMTC);
6072  adapter->stats.icrxdmtc += E1000_READ_REG(hw, E1000_ICRXDMTC);
6073 
6074  /* Fill out the OS statistics structure */
6075  net_stats->multicast = adapter->stats.mprc;
6076  net_stats->collisions = adapter->stats.colc;
6077 
6078  /* Rx Errors */
6079 
6080  /* RLEC on some newer hardware can be incorrect so build
6081  * our own version based on RUC and ROC
6082  */
6083  net_stats->rx_errors = adapter->stats.rxerrc +
6084  adapter->stats.crcerrs + adapter->stats.algnerrc +
6085  adapter->stats.ruc + adapter->stats.roc +
6086  adapter->stats.cexterr;
6087  net_stats->rx_length_errors = adapter->stats.ruc +
6088  adapter->stats.roc;
6089  net_stats->rx_crc_errors = adapter->stats.crcerrs;
6090  net_stats->rx_frame_errors = adapter->stats.algnerrc;
6091  net_stats->rx_missed_errors = adapter->stats.mpc;
6092 
6093  /* Tx Errors */
6094  net_stats->tx_errors = adapter->stats.ecol +
6095  adapter->stats.latecol;
6096  net_stats->tx_aborted_errors = adapter->stats.ecol;
6097  net_stats->tx_window_errors = adapter->stats.latecol;
6098  net_stats->tx_carrier_errors = adapter->stats.tncrs;
6099 
6100  /* Tx Dropped needs to be maintained elsewhere */
6101 
6102  /* Phy Stats */
6103  if (hw->phy.media_type == e1000_media_type_copper) {
6104  if ((adapter->link_speed == SPEED_1000) &&
6105  (!e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_tmp))) {
6106  phy_tmp &= PHY_IDLE_ERROR_COUNT_MASK;
6107  adapter->phy_stats.idle_errors += phy_tmp;
6108  }
6109  }
6110 
6111  /* Management Stats */
6112  adapter->stats.mgptc += E1000_READ_REG(hw, E1000_MGTPTC);
6113  adapter->stats.mgprc += E1000_READ_REG(hw, E1000_MGTPRC);
6114  if (hw->mac.type > e1000_82580) {
6115  adapter->stats.o2bgptc += E1000_READ_REG(hw, E1000_O2BGPTC);
6116  adapter->stats.o2bspc += E1000_READ_REG(hw, E1000_O2BSPC);
6117  adapter->stats.b2ospc += E1000_READ_REG(hw, E1000_B2OSPC);
6118  adapter->stats.b2ogprc += E1000_READ_REG(hw, E1000_B2OGPRC);
6119  }
6120 }
unsigned int num_q_vectors
Definition: igb.h:540
#define E1000_ROC
Definition: e1000_regs.h:299
#define E1000_PRC511
Definition: e1000_regs.h:285
struct e1000_hw hw
Definition: igb.h:594
#define E1000_ECOL
Definition: e1000_regs.h:268
#define E1000_GORCL
Definition: e1000_regs.h:292
#define E1000_XONTXC
Definition: e1000_regs.h:278
u32 flushed
Definition: igb.h:227
#define E1000_TPT
Definition: e1000_regs.h:309
#define E1000_TORH
Definition: e1000_regs.h:305
#define E1000_RLEC
Definition: e1000_regs.h:276
#define E1000_COLC
Definition: e1000_regs.h:271
struct igb_lro_stats stats
Definition: igb.h:248
#define E1000_PRC127
Definition: e1000_regs.h:283
#define E1000_CTRL_EXT
Definition: e1000_regs.h:32
struct net_device * netdev
Definition: igb.h:535
struct e1000_phy_info phy
Definition: e1000_hw.h:764
#define E1000_TOTH
Definition: e1000_regs.h:307
#define E1000_FCRUC
Definition: e1000_regs.h:281
#define E1000_ICRXOC
Definition: e1000_regs.h:328
#define E1000_MPRC
Definition: e1000_regs.h:290
struct pci_dev * pdev
Definition: igb.h:582
#define E1000_PTC255
Definition: e1000_regs.h:312
Definition: igb.h:365
#define E1000_O2BSPC
Definition: e1000_regs.h:631
#define E1000_IAC
Definition: e1000_regs.h:320
u32 coal
Definition: igb.h:228
#define E1000_PRC1023
Definition: e1000_regs.h:286
struct igb_lro_stats lro_stats
Definition: igb.h:590
#define E1000_TSCTC
Definition: e1000_regs.h:318
#define E1000_SYMERRS
Definition: e1000_regs.h:264
int num_tx_queues
Definition: igb.h:547
#define E1000_MGTPRC
Definition: e1000_regs.h:301
#define E1000_RUC
Definition: e1000_regs.h:297
#define E1000_BPRC
Definition: e1000_regs.h:289
#define E1000_PTC511
Definition: e1000_regs.h:313
#define E1000_ICTXQEC
Definition: e1000_regs.h:325
enum e1000_media_type media_type
Definition: e1000_hw.h:657
#define PHY_1000T_STATUS
#define E1000_B2OGPRC
Definition: e1000_regs.h:629
int num_rx_queues
Definition: igb.h:551
#define E1000_MPC
Definition: e1000_regs.h:266
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define E1000_XOFFRXC
Definition: e1000_regs.h:279
enum e1000_mac_type type
Definition: e1000_hw.h:602
#define E1000_MPTC
Definition: e1000_regs.h:316
u_int16_t u16
Definition: e1000_osdep.h:51
#define E1000_GORCH
Definition: e1000_regs.h:293
#define E1000_CRCERRS
Definition: e1000_regs.h:262
#define E1000_RFC
Definition: e1000_regs.h:298
struct igb_lro_list lrolist
Definition: igb.h:423
#define E1000_PRC255
Definition: e1000_regs.h:284
#define E1000_RXERRC
Definition: e1000_regs.h:265
#define E1000_RNBC
Definition: e1000_regs.h:296
#define E1000_DC
Definition: e1000_regs.h:272
#define E1000_PRC1522
Definition: e1000_regs.h:287
struct igb_ring * rx_ring[IGB_MAX_RX_QUEUES]
Definition: igb.h:552
#define PHY_IDLE_ERROR_COUNT_MASK
#define E1000_GPRC
Definition: e1000_regs.h:288
#define E1000_RJC
Definition: e1000_regs.h:300
#define E1000_SCC
Definition: e1000_regs.h:267
#define E1000_ICRXATC
Definition: e1000_regs.h:322
struct igb_q_vector * q_vector[MAX_Q_VECTORS]
Definition: igb.h:607
#define E1000_GOTCH
Definition: e1000_regs.h:295
struct igb_ring * tx_ring[IGB_MAX_TX_QUEUES]
Definition: igb.h:548
s32 e1000_read_phy_reg(struct e1000_hw *hw, u32 offset, u16 *data)
Definition: e1000_api.c:750
#define E1000_BPTC
Definition: e1000_regs.h:317
#define SPEED_1000
#define E1000_PRC64
Definition: e1000_regs.h:282
#define E1000_MCC
Definition: e1000_regs.h:269
#define E1000_O2BGPTC
Definition: e1000_regs.h:630
#define E1000_ICRXDMTC
Definition: e1000_regs.h:327
#define E1000_ALGNERRC
Definition: e1000_regs.h:263
#define E1000_ICRXPTC
Definition: e1000_regs.h:321
#define E1000_MGTPTC
Definition: e1000_regs.h:303
#define E1000_GOTCL
Definition: e1000_regs.h:294
#define E1000_LATECOL
Definition: e1000_regs.h:270
#define E1000_ICTXPTC
Definition: e1000_regs.h:323
#define E1000_GPTC
Definition: e1000_regs.h:291
#define E1000_XONRXC
Definition: e1000_regs.h:277
struct e1000_hw_stats stats
Definition: igb.h:595
#define E1000_XOFFTXC
Definition: e1000_regs.h:280
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
struct igb_rx_queue_stats rx_stats
Definition: igb.h:395
#define E1000_TNCRS
Definition: e1000_regs.h:273
u16 link_speed
Definition: igb.h:561
#define E1000_PTC1522
Definition: e1000_regs.h:315
#define E1000_PTC64
Definition: e1000_regs.h:310
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_ICTXATC
Definition: e1000_regs.h:324
#define E1000_CTRL_EXT_LINK_MODE_MASK
Definition: e1000_defines.h:74
#define E1000_B2OSPC
Definition: e1000_regs.h:628
struct igb_tx_queue_stats tx_stats
Definition: igb.h:391
u_int64_t u64
Definition: e1000_osdep.h:49
#define E1000_TPR
Definition: e1000_regs.h:308
#define E1000_PTC1023
Definition: e1000_regs.h:314
#define E1000_SEC
Definition: e1000_regs.h:274
#define E1000_RQDPC(_n)
Definition: e1000_regs.h:202
#define E1000_PTC127
Definition: e1000_regs.h:311
struct e1000_phy_stats phy_stats
Definition: igb.h:597
#define E1000_ICTXQMTC
Definition: e1000_regs.h:326
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
#define E1000_TSCTFC
Definition: e1000_regs.h:319

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_vf_configure ( struct igb_adapter adapter,
int  vf 
)
static

igb_main.c 파일의 6403 번째 라인에서 정의되었습니다.

6404 {
6405  unsigned char mac_addr[ETH_ALEN];
6406 
6407  random_ether_addr(mac_addr);
6408  igb_set_vf_mac(adapter, vf, mac_addr);
6409 
6410 #ifdef IFLA_VF_MAX
6411 #ifdef HAVE_VF_SPOOFCHK_CONFIGURE
6412  /* By default spoof check is enabled for all VFs */
6413  adapter->vf_data[vf].spoofchk_enabled = true;
6414 #endif
6415 #endif
6416 
6417  return true;
6418 }
static int igb_set_vf_mac(struct igb_adapter *, int, unsigned char *)
Definition: igb_main.c:9716
#define ETH_ALEN
struct vf_data_storage * vf_data
Definition: igb.h:615

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_vf_reset ( struct igb_adapter adapter,
u32  vf 
)
inlinestatic

igb_main.c 파일의 6872 번째 라인에서 정의되었습니다.

6873 {
6874  struct e1000_hw *hw = &adapter->hw;
6875 
6876  /* clear flags except flag that the PF has set the MAC */
6877  adapter->vf_data[vf].flags &= IGB_VF_FLAG_PF_SET_MAC;
6878  adapter->vf_data[vf].last_nack = jiffies;
6879 
6880  /* reset offloads to defaults */
6881  igb_set_vmolr(adapter, vf, true);
6882 
6883  /* reset vlans for device */
6884  igb_clear_vf_vfta(adapter, vf);
6885 #ifdef IFLA_VF_MAX
6886  if (adapter->vf_data[vf].pf_vlan)
6887 #ifdef IFLA_VF_VLAN_INFO_MAX
6888  igb_ndo_set_vf_vlan(adapter->netdev, vf,
6889  adapter->vf_data[vf].pf_vlan,
6890  adapter->vf_data[vf].pf_qos, 0);
6891 #else
6892 
6893  igb_ndo_set_vf_vlan(adapter->netdev, vf,
6894  adapter->vf_data[vf].pf_vlan,
6895  adapter->vf_data[vf].pf_qos);
6896 #endif
6897  else
6898  igb_clear_vf_vfta(adapter, vf);
6899 #endif
6900 
6901  /* reset multicast table array for vf */
6902  adapter->vf_data[vf].num_vf_mc_hashes = 0;
6903 
6904  /* Flush and reset the mta with the new values */
6905  igb_set_rx_mode(adapter->netdev);
6906 
6907  /*
6908  * Reset the VFs TDWBAL and TDWBAH registers which are not
6909  * cleared by a VFLR
6910  */
6911  E1000_WRITE_REG(hw, E1000_TDWBAH(vf), 0);
6912  E1000_WRITE_REG(hw, E1000_TDWBAL(vf), 0);
6913  if (hw->mac.type == e1000_82576) {
6916  }
6917 }
#define E1000_TDWBAL(_n)
Definition: e1000_regs.h:219
struct e1000_hw hw
Definition: igb.h:594
static void igb_set_vmolr(struct igb_adapter *adapter, int vfn, bool aupe)
Definition: igb_main.c:3986
static void igb_clear_vf_vfta(struct igb_adapter *adapter, u32 vf)
Definition: igb_main.c:6572
struct net_device * netdev
Definition: igb.h:535
#define IGB_VF_FLAG_PF_SET_MAC
Definition: igb.h:163
struct e1000_dev_spec_vf vf
Definition: e1000_hw.h:772
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
#define E1000_TDWBAH(_n)
Definition: e1000_regs.h:221
struct vf_data_storage * vf_data
Definition: igb.h:615
#define IGB_MAX_VF_FUNCTIONS
Definition: igb.h:132
static void igb_set_rx_mode(struct net_device *)
Definition: igb_main.c:4567
u16 num_vf_mc_hashes
Definition: igb.h:143
u32 flags
Definition: igb.h:148
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
unsigned long last_nack
Definition: igb.h:149

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_vf_reset_event ( struct igb_adapter adapter,
u32  vf 
)
static

igb_main.c 파일의 6919 번째 라인에서 정의되었습니다.

6920 {
6921  unsigned char *vf_mac = adapter->vf_data[vf].vf_mac_addresses;
6922 
6923  /* generate a new mac address as we were hotplug removed/added */
6924  if (!(adapter->vf_data[vf].flags & IGB_VF_FLAG_PF_SET_MAC))
6925  random_ether_addr(vf_mac);
6926 
6927  /* process remaining reset events */
6928  igb_vf_reset(adapter, vf);
6929 }
#define IGB_VF_FLAG_PF_SET_MAC
Definition: igb.h:163
unsigned char vf_mac_addresses[ETH_ALEN]
Definition: igb.h:141
struct e1000_dev_spec_vf vf
Definition: e1000_hw.h:772
struct vf_data_storage * vf_data
Definition: igb.h:615
u32 flags
Definition: igb.h:148
static void igb_vf_reset(struct igb_adapter *adapter, u32 vf)
Definition: igb_main.c:6872

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_vf_reset_msg ( struct igb_adapter adapter,
u32  vf 
)
static

igb_main.c 파일의 6931 번째 라인에서 정의되었습니다.

6932 {
6933  struct e1000_hw *hw = &adapter->hw;
6934  unsigned char *vf_mac = adapter->vf_data[vf].vf_mac_addresses;
6935  int rar_entry = hw->mac.rar_entry_count - (vf + 1);
6936  u32 reg, msgbuf[3];
6937  u8 *addr = (u8 *)(&msgbuf[1]);
6938 
6939  /* process all the same items cleared in a function level reset */
6940  igb_vf_reset(adapter, vf);
6941 
6942  /* set vf mac address */
6943  igb_rar_set_qsel(adapter, vf_mac, rar_entry, vf);
6944 
6945  /* enable transmit and receive for vf */
6946  reg = E1000_READ_REG(hw, E1000_VFTE);
6947  E1000_WRITE_REG(hw, E1000_VFTE, reg | (1 << vf));
6948  reg = E1000_READ_REG(hw, E1000_VFRE);
6949  E1000_WRITE_REG(hw, E1000_VFRE, reg | (1 << vf));
6950 
6951  adapter->vf_data[vf].flags |= IGB_VF_FLAG_CTS;
6952 
6953  /* reply to reset with ack and vf mac address */
6954  msgbuf[0] = E1000_VF_RESET | E1000_VT_MSGTYPE_ACK;
6955  memcpy(addr, vf_mac, 6);
6956  e1000_write_mbx(hw, msgbuf, 3, vf);
6957 }
struct e1000_hw hw
Definition: igb.h:594
#define E1000_VFRE
Definition: e1000_regs.h:490
static void igb_rar_set_qsel(struct igb_adapter *, u8 *, u32, u8)
Definition: igb_main.c:4478
unsigned char vf_mac_addresses[ETH_ALEN]
Definition: igb.h:141
#define E1000_VT_MSGTYPE_ACK
Definition: e1000_mbx.h:48
struct e1000_dev_spec_vf vf
Definition: e1000_hw.h:772
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define E1000_VF_RESET
Definition: e1000_mbx.h:57
#define IGB_VF_FLAG_CTS
Definition: igb.h:160
struct vf_data_storage * vf_data
Definition: igb.h:615
char * msgbuf
Definition: mrpValidate.c:75
u_int8_t u8
Definition: e1000_osdep.h:52
u32 flags
Definition: igb.h:148
static void igb_vf_reset(struct igb_adapter *adapter, u32 vf)
Definition: igb_main.c:6872
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_VFTE
Definition: e1000_regs.h:491
s32 e1000_write_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
Definition: e1000_mbx.c:88
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
u16 rar_entry_count
Definition: e1000_hw.h:623

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_vfta_set ( struct igb_adapter adapter,
u32  vid,
bool  add 
)
static

igb_main.c 파일의 350 번째 라인에서 정의되었습니다.

351 {
352  struct e1000_hw *hw = &adapter->hw;
353  struct e1000_host_mng_dhcp_cookie *mng_cookie = &hw->mng_cookie;
355  u32 mask = 1 << (vid & E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
356  u32 vfta;
357 
358  /*
359  * if this is the management vlan the only option is to add it in so
360  * that the management pass through will continue to work
361  */
362  if ((mng_cookie->status & E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
363  (vid == mng_cookie->vlan_id))
364  add = TRUE;
365 
366  vfta = adapter->shadow_vfta[index];
367 
368  if (add)
369  vfta |= mask;
370  else
371  vfta &= ~mask;
372 
373  e1000_write_vfta(hw, index, vfta);
374  adapter->shadow_vfta[index] = vfta;
375 }
struct e1000_hw hw
Definition: igb.h:594
#define E1000_VFTA_ENTRY_MASK
Definition: e1000_manage.h:66
#define E1000_VFTA_ENTRY_BIT_SHIFT_MASK
Definition: e1000_manage.h:67
struct e1000_host_mng_dhcp_cookie mng_cookie
Definition: e1000_hw.h:768
void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
Definition: e1000_api.c:336
u32 * shadow_vfta
Definition: igb.h:636
#define TRUE
Definition: maap_log.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_VFTA_ENTRY_SHIFT
Definition: e1000_manage.h:65
#define E1000_MNG_DHCP_COOKIE_STATUS_VLAN
Definition: e1000_manage.h:63

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

void igb_vlan_mode ( struct net_device *  netdev,
u32  features 
)

igb_main.c 파일의 8962 번째 라인에서 정의되었습니다.

8964 {
8965  struct igb_adapter *adapter = netdev_priv(netdev);
8966  struct e1000_hw *hw = &adapter->hw;
8967  u32 ctrl, rctl;
8968  int i;
8969 #ifdef HAVE_VLAN_RX_REGISTER
8970  bool enable = !!vlgrp;
8971 
8972  igb_irq_disable(adapter);
8973 
8974  adapter->vlgrp = vlgrp;
8975 
8976  if (!test_bit(__IGB_DOWN, &adapter->state))
8977  igb_irq_enable(adapter);
8978 #else
8979 #ifdef NETIF_F_HW_VLAN_CTAG_RX
8980  bool enable = !!(features & NETIF_F_HW_VLAN_CTAG_RX);
8981 #else
8982  bool enable = !!(features & NETIF_F_HW_VLAN_RX);
8983 #endif
8984 #endif
8985 
8986  if (enable) {
8987  /* enable VLAN tag insert/strip */
8988  ctrl = E1000_READ_REG(hw, E1000_CTRL);
8989  ctrl |= E1000_CTRL_VME;
8990  E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
8991 
8992  /* Disable CFI check */
8993  rctl = E1000_READ_REG(hw, E1000_RCTL);
8994  rctl &= ~E1000_RCTL_CFIEN;
8995  E1000_WRITE_REG(hw, E1000_RCTL, rctl);
8996  } else {
8997  /* disable VLAN tag insert/strip */
8998  ctrl = E1000_READ_REG(hw, E1000_CTRL);
8999  ctrl &= ~E1000_CTRL_VME;
9000  E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
9001  }
9002 
9003 #ifndef CONFIG_IGB_VMDQ_NETDEV
9004  for (i = 0; i < adapter->vmdq_pools; i++) {
9005  igb_set_vf_vlan_strip(adapter,
9006  adapter->vfs_allocated_count + i,
9007  enable);
9008  }
9009 
9010 #else
9011  igb_set_vf_vlan_strip(adapter,
9012  adapter->vfs_allocated_count,
9013  enable);
9014 
9015  for (i = 1; i < adapter->vmdq_pools; i++) {
9016 #ifdef HAVE_VLAN_RX_REGISTER
9017  struct igb_vmdq_adapter *vadapter;
9018 
9019  vadapter = netdev_priv(adapter->vmdq_netdev[i-1]);
9020 
9021  enable = !!vadapter->vlgrp;
9022 #else
9023  struct net_device *vnetdev;
9024 
9025  vnetdev = adapter->vmdq_netdev[i-1];
9026 #ifdef NETIF_F_HW_VLAN_CTAG_RX
9027  enable = !!(vnetdev->features & NETIF_F_HW_VLAN_CTAG_RX);
9028 #else
9029  enable = !!(vnetdev->features & NETIF_F_HW_VLAN_RX);
9030 #endif
9031 #endif
9032  igb_set_vf_vlan_strip(adapter,
9033  adapter->vfs_allocated_count + i,
9034  enable);
9035  }
9036 
9037 #endif
9038  igb_rlpml_set(adapter);
9039 }
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
#define E1000_CTRL
Definition: e1000_regs.h:28
#define E1000_RCTL
Definition: e1000_regs.h:61
static void igb_irq_disable(struct igb_adapter *adapter)
Definition: igb_main.c:1438
struct net_device * netdev
Definition: igb.h:535
#define E1000_RCTL_CFIEN
u32 vmdq_pools
Definition: igb.h:627
#define E1000_CTRL_VME
static void igb_rlpml_set(struct igb_adapter *adapter)
Definition: igb_main.c:3937
unsigned long state
Definition: igb.h:537
static void igb_set_vf_vlan_strip(struct igb_adapter *adapter, int vfn, bool enable)
Definition: igb_main.c:3964
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u_int32_t u32
Definition: e1000_osdep.h:50
const char features[]
Definition: feature_tests.c:2
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
static void igb_irq_enable(struct igb_adapter *adapter)
Definition: igb_main.c:1478

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_vlan_rx_add_vid ( struct net_device *  netdev,
u16  vid 
)
static

igb_main.c 파일의 9046 번째 라인에서 정의되었습니다.

9051 {
9052  struct igb_adapter *adapter = netdev_priv(netdev);
9053  int pf_id = adapter->vfs_allocated_count;
9054 
9055  /* attempt to add filter to vlvf array */
9056  igb_vlvf_set(adapter, vid, TRUE, pf_id);
9057 
9058  /* add the filter since PF can receive vlans w/o entry in vlvf */
9059  igb_vfta_set(adapter, vid, TRUE);
9060 #ifndef HAVE_NETDEV_VLAN_FEATURES
9061 
9062  /* Copy feature flags from netdev to the vlan netdev for this vid.
9063  * This allows things like TSO to bubble down to our vlan device.
9064  * There is no need to update netdev for vlan 0 (DCB), since it
9065  * wouldn't has v_netdev.
9066  */
9067  if (adapter->vlgrp) {
9068  struct vlan_group *vlgrp = adapter->vlgrp;
9069  struct net_device *v_netdev = vlan_group_get_device(vlgrp, vid);
9070 
9071  if (v_netdev) {
9072  v_netdev->features |= netdev->features;
9073  vlan_group_set_device(vlgrp, vid, v_netdev);
9074  }
9075  }
9076 #endif
9077 #ifndef HAVE_VLAN_RX_REGISTER
9078 
9079  set_bit(vid, adapter->active_vlans);
9080 #endif
9081 #ifdef HAVE_INT_NDO_VLAN_RX_ADD_VID
9082  return 0;
9083 #endif
9084 }
unsigned int vfs_allocated_count
Definition: igb.h:621
struct net_device * netdev
Definition: igb.h:535
s32 igb_vlvf_set(struct igb_adapter *adapter, u32 vid, bool add, u32 vf)
Definition: igb_main.c:6606
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]
Definition: igb.h:533
#define TRUE
Definition: maap_log.h:91
static void igb_vfta_set(struct igb_adapter *adapter, u32 vid, bool add)
Definition: igb_main.c:350

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_vlan_rx_kill_vid ( struct net_device *  netdev,
u16  vid 
)
static

igb_main.c 파일의 9091 번째 라인에서 정의되었습니다.

9096 {
9097  struct igb_adapter *adapter = netdev_priv(netdev);
9098  int pf_id = adapter->vfs_allocated_count;
9099  s32 err;
9100 
9101 #ifdef HAVE_VLAN_RX_REGISTER
9102  igb_irq_disable(adapter);
9103 
9104  vlan_group_set_device(adapter->vlgrp, vid, NULL);
9105 
9106  if (!test_bit(__IGB_DOWN, &adapter->state))
9107  igb_irq_enable(adapter);
9108 
9109 #endif /* HAVE_VLAN_RX_REGISTER */
9110  /* remove vlan from VLVF table array */
9111  err = igb_vlvf_set(adapter, vid, FALSE, pf_id);
9112 
9113  /* if vid was not present in VLVF just remove it from table */
9114  if (err)
9115  igb_vfta_set(adapter, vid, FALSE);
9116 #ifndef HAVE_VLAN_RX_REGISTER
9117 
9118  clear_bit(vid, adapter->active_vlans);
9119 #endif
9120 #ifdef HAVE_INT_NDO_VLAN_RX_ADD_VID
9121  return 0;
9122 #endif
9123 }
unsigned int vfs_allocated_count
Definition: igb.h:621
int err
static void igb_irq_disable(struct igb_adapter *adapter)
Definition: igb_main.c:1438
struct net_device * netdev
Definition: igb.h:535
s32 igb_vlvf_set(struct igb_adapter *adapter, u32 vid, bool add, u32 vf)
Definition: igb_main.c:6606
#define FALSE
Definition: maap_log.h:94
unsigned long state
Definition: igb.h:537
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]
Definition: igb.h:533
int32_t s32
Definition: e1000_osdep.h:54
#define NULL
Null pointer value.
static void igb_irq_enable(struct igb_adapter *adapter)
Definition: igb_main.c:1478
static void igb_vfta_set(struct igb_adapter *adapter, u32 vid, bool add)
Definition: igb_main.c:350

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

s32 igb_vlvf_set ( struct igb_adapter adapter,
u32  vid,
bool  add,
u32  vf 
)

igb_main.c 파일의 6606 번째 라인에서 정의되었습니다.

6607 {
6608  struct e1000_hw *hw = &adapter->hw;
6609  u32 reg, i;
6610 
6611  /* The vlvf table only exists on 82576 hardware and newer */
6612  if (hw->mac.type < e1000_82576)
6613  return -1;
6614 
6615  /* we only need to do this if VMDq is enabled */
6616  if (!adapter->vmdq_pools)
6617  return -1;
6618 
6619  /* Find the vlan filter for this id */
6620  for (i = 0; i < E1000_VLVF_ARRAY_SIZE; i++) {
6621  reg = E1000_READ_REG(hw, E1000_VLVF(i));
6622  if ((reg & E1000_VLVF_VLANID_ENABLE) &&
6623  vid == (reg & E1000_VLVF_VLANID_MASK))
6624  break;
6625  }
6626 
6627  if (add) {
6628  if (i == E1000_VLVF_ARRAY_SIZE) {
6629  /* Did not find a matching VLAN ID entry that was
6630  * enabled. Search for a free filter entry, i.e.
6631  * one without the enable bit set
6632  */
6633  for (i = 0; i < E1000_VLVF_ARRAY_SIZE; i++) {
6634  reg = E1000_READ_REG(hw, E1000_VLVF(i));
6635  if (!(reg & E1000_VLVF_VLANID_ENABLE))
6636  break;
6637  }
6638  }
6639  if (i < E1000_VLVF_ARRAY_SIZE) {
6640  /* Found an enabled/available entry */
6641  reg |= 1 << (E1000_VLVF_POOLSEL_SHIFT + vf);
6642 
6643  /* if !enabled we need to set this up in vfta */
6644  if (!(reg & E1000_VLVF_VLANID_ENABLE)) {
6645  /* add VID to filter table */
6646  igb_vfta_set(adapter, vid, TRUE);
6647  reg |= E1000_VLVF_VLANID_ENABLE;
6648  }
6649  reg &= ~E1000_VLVF_VLANID_MASK;
6650  reg |= vid;
6651  E1000_WRITE_REG(hw, E1000_VLVF(i), reg);
6652 
6653  /* do not modify RLPML for PF devices */
6654  if (vf >= adapter->vfs_allocated_count)
6655  return E1000_SUCCESS;
6656 
6657  if (!adapter->vf_data[vf].vlans_enabled) {
6658  u32 size;
6659 
6660  reg = E1000_READ_REG(hw, E1000_VMOLR(vf));
6661  size = reg & E1000_VMOLR_RLPML_MASK;
6662  size += 4;
6663  reg &= ~E1000_VMOLR_RLPML_MASK;
6664  reg |= size;
6665  E1000_WRITE_REG(hw, E1000_VMOLR(vf), reg);
6666  }
6667 
6668  adapter->vf_data[vf].vlans_enabled++;
6669  }
6670  } else {
6671  if (i < E1000_VLVF_ARRAY_SIZE) {
6672  /* remove vf from the pool */
6673  reg &= ~(1 << (E1000_VLVF_POOLSEL_SHIFT + vf));
6674  /* if pool is empty then remove entry from vfta */
6675  if (!(reg & E1000_VLVF_POOLSEL_MASK)) {
6676  reg = 0;
6677  igb_vfta_set(adapter, vid, FALSE);
6678  }
6679  E1000_WRITE_REG(hw, E1000_VLVF(i), reg);
6680 
6681  /* do not modify RLPML for PF devices */
6682  if (vf >= adapter->vfs_allocated_count)
6683  return E1000_SUCCESS;
6684 
6685  adapter->vf_data[vf].vlans_enabled--;
6686  if (!adapter->vf_data[vf].vlans_enabled) {
6687  u32 size;
6688 
6689  reg = E1000_READ_REG(hw, E1000_VMOLR(vf));
6690  size = reg & E1000_VMOLR_RLPML_MASK;
6691  size -= 4;
6692  reg &= ~E1000_VMOLR_RLPML_MASK;
6693  reg |= size;
6694  E1000_WRITE_REG(hw, E1000_VMOLR(vf), reg);
6695  }
6696  }
6697  }
6698  return E1000_SUCCESS;
6699 }
#define E1000_VMOLR_RLPML_MASK
Definition: e1000_82575.h:414
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
#define E1000_VLVF_ARRAY_SIZE
Definition: e1000_82575.h:434
#define E1000_VLVF(_n)
Definition: e1000_regs.h:514
struct e1000_dev_spec_vf vf
Definition: e1000_hw.h:772
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define E1000_VLVF_VLANID_ENABLE
Definition: e1000_82575.h:439
enum e1000_mac_type type
Definition: e1000_hw.h:602
u32 vmdq_pools
Definition: igb.h:627
u16 vlans_enabled
Definition: igb.h:145
#define FALSE
Definition: maap_log.h:94
struct vf_data_storage * vf_data
Definition: igb.h:615
int size
#define E1000_SUCCESS
#define E1000_VMOLR(_n)
Definition: e1000_regs.h:512
#define TRUE
Definition: maap_log.h:91
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_VLVF_POOLSEL_MASK
Definition: e1000_82575.h:437
u_int32_t u32
Definition: e1000_osdep.h:50
#define E1000_VLVF_POOLSEL_SHIFT
Definition: e1000_82575.h:436
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57
static void igb_vfta_set(struct igb_adapter *adapter, u32 vid, bool add)
Definition: igb_main.c:350
#define E1000_VLVF_VLANID_MASK
Definition: e1000_82575.h:435

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_vm_close ( struct vm_area_struct *  vma)
static

igb_main.c 파일의 10833 번째 라인에서 정의되었습니다.

10834 {
10835 }
static int igb_vm_fault ( struct vm_fault *  fdata)
static

igb_main.c 파일의 10837 번째 라인에서 정의되었습니다.

10841 {
10842  return VM_FAULT_SIGBUS;
10843 }
static void igb_vm_open ( struct vm_area_struct *  vma)
static

igb_main.c 파일의 10829 번째 라인에서 정의되었습니다.

10830 {
10831 }
static void igb_vmm_control ( struct igb_adapter adapter)
static

igb_main.c 파일의 9881 번째 라인에서 정의되었습니다.

9882 {
9883  struct e1000_hw *hw = &adapter->hw;
9884  int count;
9885  u32 reg;
9886 
9887  switch (hw->mac.type) {
9888  case e1000_82575:
9889  default:
9890  /* replication is not supported for 82575 */
9891  return;
9892  case e1000_82576:
9893  /* notify HW that the MAC is adding vlan tags */
9894  reg = E1000_READ_REG(hw, E1000_DTXCTL);
9895  reg |= (E1000_DTXCTL_VLAN_ADDED |
9897  E1000_WRITE_REG(hw, E1000_DTXCTL, reg);
9898  /* Fall through */
9899  case e1000_82580:
9900  /* enable replication vlan tag stripping */
9901  reg = E1000_READ_REG(hw, E1000_RPLOLR);
9902  reg |= E1000_RPLOLR_STRVLAN;
9903  E1000_WRITE_REG(hw, E1000_RPLOLR, reg);
9904  /* Fall through */
9905  case e1000_i350:
9906  case e1000_i354:
9907  /* none of the above registers are supported by i350 */
9908  break;
9909  }
9910 
9911  /* Enable Malicious Driver Detection */
9912  if ((adapter->vfs_allocated_count) &&
9913  (adapter->mdd)) {
9914  if (hw->mac.type == e1000_i350)
9915  igb_enable_mdd(adapter);
9916  }
9917 
9918  /* enable replication and loopback support */
9919  count = adapter->vfs_allocated_count || adapter->vmdq_pools;
9920  if (adapter->flags & IGB_FLAG_LOOPBACK_ENABLE && count)
9923  adapter->vfs_allocated_count || adapter->vmdq_pools,
9924  adapter->vfs_allocated_count);
9926  adapter->vmdq_pools);
9927 }
struct e1000_hw hw
Definition: igb.h:594
unsigned int vfs_allocated_count
Definition: igb.h:621
#define E1000_RPLOLR_STRVLAN
Definition: e1000_82575.h:449
unsigned int flags
Definition: igb.h:538
void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf)
Definition: e1000_82575.c:2273
bool mdd
Definition: igb.h:623
void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable)
Definition: e1000_82575.c:2311
struct e1000_mac_info mac
Definition: e1000_hw.h:762
void e1000_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable)
Definition: e1000_82575.c:2348
enum e1000_mac_type type
Definition: e1000_hw.h:602
u32 vmdq_pools
Definition: igb.h:627
#define E1000_DTXCTL_VLAN_ADDED
Definition: e1000_82575.h:456
#define E1000_DTXCTL
Definition: e1000_regs.h:255
#define E1000_DTXCTL_SPOOF_INT
Definition: e1000_82575.h:459
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
#define E1000_RPLOLR
Definition: e1000_regs.h:495
u_int32_t u32
Definition: e1000_osdep.h:50
static void igb_enable_mdd(struct igb_adapter *adapter)
Definition: igb_main.c:929
#define IGB_FLAG_LOOPBACK_ENABLE
Definition: igb.h:725
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_watchdog ( struct timer_list *  timer)
static

igb_watchdog - Timer Call-back : pointer to adapter cast into an unsigned long

igb_main.c 파일의 4762 번째 라인에서 정의되었습니다.

4766 {
4767  struct igb_adapter *adapter;
4768 
4769 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
4770  adapter = container_of(timer, struct igb_adapter, watchdog_timer);
4771 #else
4772  adapter = (struct igb_adapter *)data;
4773 #endif
4774 
4775  /* Do the rest outside of interrupt context */
4776  schedule_work(&adapter->watchdog_task);
4777 }
struct timer_list watchdog_timer
Definition: igb.h:554
struct work_struct watchdog_task
Definition: igb.h:570

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_watchdog_task ( struct work_struct *  work)
static

igb_main.c 파일의 4779 번째 라인에서 정의되었습니다.

4780 {
4781  struct igb_adapter *adapter = container_of(work,
4782  struct igb_adapter,
4783  watchdog_task);
4784  struct e1000_hw *hw = &adapter->hw;
4785  struct net_device *netdev = adapter->netdev;
4786  u32 thstat, ctrl_ext, link;
4787  int i;
4788  u32 connsw;
4789 
4790  link = igb_has_link(adapter);
4791 
4792  /* Force link down if we have fiber to swap to */
4793  if (adapter->flags & IGB_FLAG_MAS_ENABLE) {
4794  if (hw->phy.media_type == e1000_media_type_copper) {
4795  connsw = E1000_READ_REG(hw, E1000_CONNSW);
4796  if (!(connsw & E1000_CONNSW_AUTOSENSE_EN))
4797  link = 0;
4798  }
4799  }
4800  if (adapter->flags & IGB_FLAG_NEED_LINK_UPDATE) {
4801  if (time_after(jiffies, (adapter->link_check_timeout + HZ)))
4802  adapter->flags &= ~IGB_FLAG_NEED_LINK_UPDATE;
4803  else
4804  link = FALSE;
4805  }
4806 
4807  if (link) {
4808  /* Perform a reset if the media type changed. */
4809  if (hw->dev_spec._82575.media_changed) {
4810  hw->dev_spec._82575.media_changed = false;
4811  adapter->flags |= IGB_FLAG_MEDIA_RESET;
4812  igb_reset(adapter);
4813  }
4814 
4815  /* Cancel scheduled suspend requests. */
4816  pm_runtime_resume(netdev->dev.parent);
4817 
4818  if (!netif_carrier_ok(netdev)) {
4819  u32 ctrl;
4820 
4822  &adapter->link_speed,
4823  &adapter->link_duplex);
4824 
4825  ctrl = E1000_READ_REG(hw, E1000_CTRL);
4826  /* Links status message must follow this format */
4827  netdev_info(netdev,
4828  "igb: %s NIC Link is Up %d Mbps %s, Flow Control: %s\n",
4829  netdev->name,
4830  adapter->link_speed,
4831  adapter->link_duplex == FULL_DUPLEX ?
4832  "Full Duplex" : "Half Duplex",
4833  ((ctrl & E1000_CTRL_TFCE) &&
4834  (ctrl & E1000_CTRL_RFCE)) ? "RX/TX" :
4835  ((ctrl & E1000_CTRL_RFCE) ? "RX" :
4836  ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None")));
4837  /* adjust timeout factor according to speed/duplex */
4838  adapter->tx_timeout_factor = 1;
4839  switch (adapter->link_speed) {
4840  case SPEED_10:
4841  adapter->tx_timeout_factor = 14;
4842  break;
4843  case SPEED_100:
4844  /* maybe add some timeout factor ? */
4845  break;
4846  default:
4847  break;
4848  }
4849 
4850  netif_carrier_on(netdev);
4851  netif_tx_wake_all_queues(netdev);
4852 
4853  igb_ping_all_vfs(adapter);
4854 #ifdef IFLA_VF_MAX
4855  igb_check_vf_rate_limit(adapter);
4856 #endif /* IFLA_VF_MAX */
4857 
4858  /* link state has changed, schedule phy info update */
4859  if (!test_bit(__IGB_DOWN, &adapter->state))
4860  mod_timer(&adapter->phy_info_timer,
4861  round_jiffies(jiffies + 2 * HZ));
4862  }
4863  } else {
4864  if (netif_carrier_ok(netdev)) {
4865  adapter->link_speed = 0;
4866  adapter->link_duplex = 0;
4867  /* check for thermal sensor event on i350 */
4868  if (hw->mac.type == e1000_i350) {
4869  thstat = E1000_READ_REG(hw, E1000_THSTAT);
4870  ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
4871  if ((hw->phy.media_type ==
4873  !(ctrl_ext &
4875  if (thstat & E1000_THSTAT_PWR_DOWN) {
4876  netdev_err(netdev,
4877  "igb: %s The network adapter was stopped because it overheated.\n",
4878  netdev->name);
4879  }
4880  if (thstat &
4882  netdev_err(netdev,
4883  "igb: %s The network adapter supported link speed was downshifted because it overheated.\n",
4884  netdev->name);
4885  }
4886  }
4887  }
4888 
4889  /* Links status message must follow this format */
4890  netdev_info(netdev, "igb: %s NIC Link is Down\n",
4891  netdev->name);
4892  netif_carrier_off(netdev);
4893  netif_tx_stop_all_queues(netdev);
4894 
4895  igb_ping_all_vfs(adapter);
4896 
4897  /* link state has changed, schedule phy info update */
4898  if (!test_bit(__IGB_DOWN, &adapter->state))
4899  mod_timer(&adapter->phy_info_timer,
4900  round_jiffies(jiffies + 2 * HZ));
4901  /* link is down, time to check for alternate media */
4902  if (adapter->flags & IGB_FLAG_MAS_ENABLE) {
4903  igb_check_swap_media(adapter);
4904  if (adapter->flags & IGB_FLAG_MEDIA_RESET) {
4905  schedule_work(&adapter->reset_task);
4906  /* return immediately */
4907  return;
4908  }
4909  }
4910  pm_schedule_suspend(netdev->dev.parent,
4911  MSEC_PER_SEC * 5);
4912 
4913  /* also check for alternate media here */
4914  } else if (!netif_carrier_ok(netdev) &&
4915  (adapter->flags & IGB_FLAG_MAS_ENABLE)) {
4916  hw->mac.ops.power_up_serdes(hw);
4917  igb_check_swap_media(adapter);
4918  if (adapter->flags & IGB_FLAG_MEDIA_RESET) {
4919  schedule_work(&adapter->reset_task);
4920  /* return immediately */
4921  return;
4922  }
4923  }
4924  }
4925 
4926  igb_update_stats(adapter);
4927 
4928  for (i = 0; i < adapter->num_tx_queues; i++) {
4929  struct igb_ring *tx_ring = adapter->tx_ring[i];
4930 
4931  if (!netif_carrier_ok(netdev)) {
4932  /* We've lost link, so the controller stops DMA,
4933  * but we've got queued Tx work that's never going
4934  * to get done, so reset controller to flush Tx.
4935  * (Do the reset outside of interrupt context).
4936  */
4937  if (igb_desc_unused(tx_ring) + 1 < tx_ring->count) {
4938  adapter->tx_timeout_count++;
4939  schedule_work(&adapter->reset_task);
4940  /* return immediately since reset is imminent */
4941  return;
4942  }
4943  }
4944 
4945  /* Force detection of hung controller every watchdog period */
4946  set_bit(IGB_RING_FLAG_TX_DETECT_HANG, &tx_ring->flags);
4947  }
4948 
4949  /* Cause software interrupt to ensure rx ring is cleaned */
4950  if (adapter->msix_entries) {
4951  u32 eics = 0;
4952 
4953  for (i = 0; i < adapter->num_q_vectors; i++)
4954  eics |= adapter->q_vector[i]->eims_value;
4955  E1000_WRITE_REG(hw, E1000_EICS, eics);
4956  } else {
4958  }
4959 
4960  igb_spoof_check(adapter);
4961 
4962  /* Reset the timer */
4963  if (!test_bit(__IGB_DOWN, &adapter->state)) {
4964  if (adapter->flags & IGB_FLAG_NEED_LINK_UPDATE)
4965  mod_timer(&adapter->watchdog_timer,
4966  round_jiffies(jiffies + HZ));
4967  else
4968  mod_timer(&adapter->watchdog_timer,
4969  round_jiffies(jiffies + 2 * HZ));
4970  }
4971 }
unsigned int num_q_vectors
Definition: igb.h:540
#define E1000_THSTAT
Definition: e1000_regs.h:617
u16 count
Definition: igb.h:379
unsigned long link_check_timeout
Definition: igb.h:683
u32 tx_timeout_count
Definition: igb.h:546
struct msix_entry * msix_entries
Definition: igb.h:541
struct e1000_hw hw
Definition: igb.h:594
#define E1000_EICS
Definition: e1000_regs.h:67
#define E1000_CTRL
Definition: e1000_regs.h:28
static void igb_check_swap_media(struct igb_adapter *adapter)
Definition: igb_main.c:1643
#define E1000_CTRL_EXT
Definition: e1000_regs.h:32
struct net_device * netdev
Definition: igb.h:535
struct e1000_phy_info phy
Definition: e1000_hw.h:764
void igb_update_stats(struct igb_adapter *adapter)
Definition: igb_main.c:5908
#define IGB_FLAG_MEDIA_RESET
Definition: igb.h:726
union e1000_hw::@65 dev_spec
struct work_struct reset_task
Definition: igb.h:569
unsigned int flags
Definition: igb.h:538
Definition: igb.h:365
#define E1000_CTRL_TFCE
static void igb_spoof_check(struct igb_adapter *adapter)
Definition: igb_main.c:4658
static void igb_ping_all_vfs(struct igb_adapter *)
Definition: igb_main.c:6420
static u16 igb_desc_unused(const struct igb_ring *ring)
Definition: igb.h:481
u32 eims_value
Definition: igb.h:413
int num_tx_queues
Definition: igb.h:547
enum e1000_media_type media_type
Definition: e1000_hw.h:657
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
struct timer_list phy_info_timer
Definition: igb.h:556
#define E1000_ICS_RXDMT0
#define E1000_CTRL_RFCE
struct timer_list watchdog_timer
Definition: igb.h:554
struct work_struct watchdog_task
Definition: igb.h:570
#define FULL_DUPLEX
#define E1000_ICS
Definition: e1000_regs.h:57
u16 link_duplex
Definition: igb.h:562
#define FALSE
Definition: maap_log.h:94
unsigned long state
Definition: igb.h:537
#define E1000_THSTAT_PWR_DOWN
#define IGB_FLAG_MAS_ENABLE
Definition: igb.h:727
struct igb_q_vector * q_vector[MAX_Q_VECTORS]
Definition: igb.h:607
#define IGB_FLAG_NEED_LINK_UPDATE
Definition: igb.h:724
struct igb_ring * tx_ring[IGB_MAX_TX_QUEUES]
Definition: igb.h:548
#define E1000_CONNSW
Definition: e1000_regs.h:52
#define E1000_CTRL_EXT_LINK_MODE_SGMII
Definition: e1000_defines.h:80
#define E1000_CONNSW_AUTOSENSE_EN
#define SPEED_100
#define E1000_THSTAT_LINK_THROTTLE
struct e1000_mac_operations ops
Definition: e1000_hw.h:598
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
unsigned long flags
Definition: igb.h:374
void igb_reset(struct igb_adapter *adapter)
Definition: igb_main.c:1967
u16 link_speed
Definition: igb.h:561
u_int32_t u32
Definition: e1000_osdep.h:50
#define SPEED_10
bool igb_has_link(struct igb_adapter *adapter)
Definition: igb_main.c:4720
struct e1000_dev_spec_82575 _82575
Definition: e1000_hw.h:771
u8 tx_timeout_factor
Definition: igb.h:573
s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed, u16 *duplex)
Definition: e1000_api.c:472
void(* power_up_serdes)(struct e1000_hw *)
Definition: e1000_hw.h:515
#define E1000_READ_REG(x, y)
Definition: e1000_osdep.h:57

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static ssize_t igb_write ( struct file *  file,
const char __user *  buf,
size_t  count,
loff_t *  pos 
)
static

igb_main.c 파일의 10223 번째 라인에서 정의되었습니다.

10225 {
10226  return -EINVAL; /* don't support writes for any status or data */
10227 }
static void igb_write_itr ( struct igb_q_vector q_vector)
static

igb_main.c 파일의 6242 번째 라인에서 정의되었습니다.

6243 {
6244  struct igb_adapter *adapter = q_vector->adapter;
6245  u32 itr_val = q_vector->itr_val & 0x7FFC;
6246 
6247  if (!q_vector->set_itr)
6248  return;
6249 
6250  if (!itr_val)
6251  itr_val = 0x4;
6252 
6253  if (adapter->hw.mac.type == e1000_82575)
6254  itr_val |= itr_val << 16;
6255  else
6256  itr_val |= E1000_EITR_CNT_IGNR;
6257 
6258  writel(itr_val, q_vector->itr_register);
6259  q_vector->set_itr = 0;
6260 }
void __iomem * itr_register
Definition: igb.h:417
struct e1000_hw hw
Definition: igb.h:594
u8 set_itr
Definition: igb.h:416
struct igb_adapter * adapter
Definition: igb.h:411
struct e1000_mac_info mac
Definition: e1000_hw.h:762
enum e1000_mac_type type
Definition: e1000_hw.h:602
#define E1000_EITR_CNT_IGNR
u16 itr_val
Definition: igb.h:415
u_int32_t u32
Definition: e1000_osdep.h:50

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static void igb_write_ivar ( struct e1000_hw hw,
int  msix_vector,
int  index,
int  offset 
)
static

igb_write_ivar - configure ivar for given MSI-X vector : pointer to the HW structure : vector number we are allocating to a given ring : row index of IVAR register to write within IVAR table : column offset of in IVAR, should be multiple of 8

This function is intended to handle the writing of the IVAR register for adapters 82576 and newer. The IVAR table consists of 2 columns, each containing an cause allocation for an Rx and Tx ring, and a variable number of rows depending on the number of queues supported.

igb_main.c 파일의 540 번째 라인에서 정의되었습니다.

542 {
543  u32 ivar = E1000_READ_REG_ARRAY(hw, E1000_IVAR0, index);
544 
545  /* clear any bits that are currently set */
546  ivar &= ~((u32)0xFF << offset);
547 
548  /* write vector and valid bit */
549  ivar |= (msix_vector | E1000_IVAR_VALID) << offset;
550 
551  E1000_WRITE_REG_ARRAY(hw, E1000_IVAR0, index, ivar);
552 }
#define E1000_WRITE_REG_ARRAY(hw, reg, idx, val)
Definition: e1000_osdep.h:100
#define E1000_IVAR_VALID
Definition: e1000_defines.h:97
#define E1000_READ_REG_ARRAY(hw, reg, idx)
Definition: e1000_osdep.h:103
#define E1000_IVAR0
Definition: e1000_regs.h:73
u_int32_t u32
Definition: e1000_osdep.h:50

이 함수를 호출하는 함수들에 대한 그래프입니다.:

int igb_write_mc_addr_list ( struct net_device *  netdev)

igb_write_mc_addr_list - write multicast addresses to MTA : network interface device structure

Writes multicast address list to the MTA hash table. Returns: -ENOMEM on failure 0 on no addresses written X on writing X addresses to MTA

igb_main.c 파일의 4381 번째 라인에서 정의되었습니다.

4382 {
4383  struct igb_adapter *adapter = netdev_priv(netdev);
4384  struct e1000_hw *hw = &adapter->hw;
4385 #ifdef NETDEV_HW_ADDR_T_MULTICAST
4386  struct netdev_hw_addr *ha;
4387 #else
4388  struct dev_mc_list *ha;
4389 #endif
4390  u8 *mta_list;
4391  int i, count;
4392 #ifdef CONFIG_IGB_VMDQ_NETDEV
4393  int vm;
4394 #endif
4395  count = netdev_mc_count(netdev);
4396 #ifdef CONFIG_IGB_VMDQ_NETDEV
4397  for (vm = 1; vm < adapter->vmdq_pools; vm++) {
4398  if (!adapter->vmdq_netdev[vm])
4399  break;
4400  if (!netif_running(adapter->vmdq_netdev[vm]))
4401  continue;
4402  count += netdev_mc_count(adapter->vmdq_netdev[vm]);
4403  }
4404 #endif
4405 
4406  if (!count) {
4408  return 0;
4409  }
4410  mta_list = kzalloc(count * 6, GFP_ATOMIC);
4411  if (!mta_list)
4412  return -ENOMEM;
4413 
4414  /* The shared function expects a packed array of only addresses. */
4415  i = 0;
4416  netdev_for_each_mc_addr(ha, netdev)
4417 #ifdef NETDEV_HW_ADDR_T_MULTICAST
4418  memcpy(mta_list + (i++ * ETH_ALEN), ha->addr, ETH_ALEN);
4419 #else
4420  memcpy(mta_list + (i++ * ETH_ALEN), ha->dmi_addr, ETH_ALEN);
4421 #endif
4422 #ifdef CONFIG_IGB_VMDQ_NETDEV
4423  for (vm = 1; vm < adapter->vmdq_pools; vm++) {
4424  if (!adapter->vmdq_netdev[vm])
4425  break;
4426  if (!netif_running(adapter->vmdq_netdev[vm]) ||
4427  !netdev_mc_count(adapter->vmdq_netdev[vm]))
4428  continue;
4429  netdev_for_each_mc_addr(ha, adapter->vmdq_netdev[vm])
4430 #ifdef NETDEV_HW_ADDR_T_MULTICAST
4431  memcpy(mta_list + (i++ * ETH_ALEN),
4432  ha->addr, ETH_ALEN);
4433 #else
4434  memcpy(mta_list + (i++ * ETH_ALEN),
4435  ha->dmi_addr, ETH_ALEN);
4436 #endif
4437  }
4438 #endif
4439  e1000_update_mc_addr_list(hw, mta_list, i);
4440  kfree(mta_list);
4441 
4442  return count;
4443 }
struct e1000_hw hw
Definition: igb.h:594
struct net_device * netdev
Definition: igb.h:535
u32 vmdq_pools
Definition: igb.h:627
void e1000_update_mc_addr_list(struct e1000_hw *hw, u8 *mc_addr_list, u32 mc_addr_count)
Definition: e1000_api.c:351
#define ETH_ALEN
u_int8_t u8
Definition: e1000_osdep.h:52
#define NULL
Null pointer value.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static int igb_write_uc_addr_list ( struct net_device *  netdev)
static

igb_write_uc_addr_list - write unicast addresses to RAR table : network interface device structure

Writes unicast address list to the RAR table. Returns: -ENOMEM on failure/insufficient address space 0 on no addresses written X on writing X addresses to the RAR table

igb_main.c 파일의 4515 번째 라인에서 정의되었습니다.

4516 {
4517  struct igb_adapter *adapter = netdev_priv(netdev);
4518  struct e1000_hw *hw = &adapter->hw;
4519  unsigned int vfn = adapter->vfs_allocated_count;
4520  unsigned int rar_entries = hw->mac.rar_entry_count - (vfn + 1);
4521  int count = 0;
4522 
4523  /* return ENOMEM indicating insufficient memory for addresses */
4524  if (netdev_uc_count(netdev) > igb_available_rars(adapter))
4525  return -ENOMEM;
4526  if (!netdev_uc_empty(netdev) && rar_entries) {
4527 #ifdef NETDEV_HW_ADDR_T_UNICAST
4528  struct netdev_hw_addr *ha;
4529 #else
4530  struct dev_mc_list *ha;
4531 #endif
4532  netdev_for_each_uc_addr(ha, netdev) {
4533 #ifdef NETDEV_HW_ADDR_T_UNICAST
4534  if (!rar_entries)
4535  break;
4536  igb_rar_set_qsel(adapter, ha->addr,
4537  rar_entries--,
4538  vfn);
4539 #else
4540  igb_rar_set_qsel(adapter, ha->da_addr,
4541  rar_entries--,
4542  vfn);
4543 #endif
4544  count++;
4545  }
4546  }
4547 
4548  /* write the addresses in reverse order to avoid write combining */
4549  for (; rar_entries > 0 ; rar_entries--) {
4550  E1000_WRITE_REG(hw, E1000_RAH(rar_entries), 0);
4551  E1000_WRITE_REG(hw, E1000_RAL(rar_entries), 0);
4552  }
4553  E1000_WRITE_FLUSH(hw);
4554  return count;
4555 }
struct e1000_hw hw
Definition: igb.h:594
#define E1000_RAH(_i)
Definition: e1000_regs.h:230
unsigned int vfs_allocated_count
Definition: igb.h:621
#define E1000_RAL(_i)
Definition: e1000_regs.h:228
static void igb_rar_set_qsel(struct igb_adapter *, u8 *, u32, u8)
Definition: igb_main.c:4478
struct net_device * netdev
Definition: igb.h:535
struct e1000_mac_info mac
Definition: e1000_hw.h:762
#define E1000_WRITE_FLUSH(a)
Definition: e1000_osdep.h:127
int igb_available_rars(struct igb_adapter *adapter)
Definition: igb_main.c:4466
#define E1000_WRITE_REG(hw, reg, val)
Definition: e1000_osdep.h:91
u16 rar_entry_count
Definition: e1000_hw.h:623

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

static netdev_tx_t igb_xmit_frame ( struct sk_buff *  skb,
struct net_device *  netdev 
)
static

igb_main.c 파일의 5770 번째 라인에서 정의되었습니다.

5772 {
5773  struct igb_adapter *adapter = netdev_priv(netdev);
5774 
5775  if (test_bit(__IGB_DOWN, &adapter->state)) {
5776  dev_kfree_skb_any(skb);
5777  return NETDEV_TX_OK;
5778  }
5779 
5780  if (skb->len <= 0) {
5781  dev_kfree_skb_any(skb);
5782  return NETDEV_TX_OK;
5783  }
5784 
5785  /*
5786  * The minimum packet size with TCTL.PSP set is 17 so pad the skb
5787  * in order to meet this minimum size requirement.
5788  */
5789  if (skb->len < 17) {
5790  if (skb_padto(skb, 17))
5791  return NETDEV_TX_OK;
5792  skb->len = 17;
5793  }
5794 
5795  return igb_xmit_frame_ring(skb, igb_tx_queue_mapping(adapter, skb));
5796 }
struct net_device * netdev
Definition: igb.h:535
netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb, struct igb_ring *tx_ring)
Definition: igb_main.c:5650
unsigned long state
Definition: igb.h:537
static struct igb_ring * igb_tx_queue_mapping(struct igb_adapter *adapter, struct sk_buff *skb)
Definition: igb_main.c:5745

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

netdev_tx_t igb_xmit_frame_ring ( struct sk_buff *  skb,
struct igb_ring tx_ring 
)

igb_main.c 파일의 5650 번째 라인에서 정의되었습니다.

5652 {
5653  struct igb_tx_buffer *first;
5654  int tso;
5655  u32 tx_flags = 0;
5656 #if PAGE_SIZE > IGB_MAX_DATA_PER_TXD
5657  unsigned short f;
5658 #endif
5659  u16 count = TXD_USE_COUNT(skb_headlen(skb));
5660  __be16 protocol = vlan_get_protocol(skb);
5661  u8 hdr_len = 0;
5662 
5663  /*
5664  * need: 1 descriptor per page * PAGE_SIZE/IGB_MAX_DATA_PER_TXD,
5665  * + 1 desc for skb_headlen/IGB_MAX_DATA_PER_TXD,
5666  * + 2 desc gap to keep tail from touching head,
5667  * + 1 desc for context descriptor,
5668  * otherwise try next time
5669  */
5670 #if PAGE_SIZE > IGB_MAX_DATA_PER_TXD
5671  for (f = 0; f < skb_shinfo(skb)->nr_frags; f++)
5672  count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size);
5673 #else
5674  count += skb_shinfo(skb)->nr_frags;
5675 #endif
5676  if (igb_maybe_stop_tx(tx_ring, count + 3)) {
5677  /* this is a hard error */
5678  return NETDEV_TX_BUSY;
5679  }
5680 
5681  /* record the location of the first descriptor for this packet */
5682  first = &tx_ring->tx_buffer_info[tx_ring->next_to_use];
5683  first->skb = skb;
5684  first->bytecount = skb->len;
5685  first->gso_segs = 1;
5686 
5687 #ifdef HAVE_PTP_1588_CLOCK
5688 #ifdef SKB_SHARED_TX_IS_UNION
5689  if (unlikely(skb_tx(skb)->hardware)) {
5690 #else
5691  if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
5692 #endif
5693  struct igb_adapter *adapter = netdev_priv(tx_ring->netdev);
5694 
5695  if (!test_and_set_bit_lock(__IGB_PTP_TX_IN_PROGRESS,
5696  &adapter->state)) {
5697 #ifdef SKB_SHARED_TX_IS_UNION
5698  skb_tx(skb)->in_progress = 1;
5699 #else
5700  skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
5701 #endif
5702  tx_flags |= IGB_TX_FLAGS_TSTAMP;
5703 
5704  adapter->ptp_tx_skb = skb_get(skb);
5705  adapter->ptp_tx_start = jiffies;
5706  if (adapter->hw.mac.type == e1000_82576)
5707  schedule_work(&adapter->ptp_tx_work);
5708  }
5709  }
5710 #endif /* HAVE_PTP_1588_CLOCK */
5711  skb_tx_timestamp(skb);
5712  if (skb_vlan_tag_present(skb)) {
5713  tx_flags |= IGB_TX_FLAGS_VLAN;
5714  tx_flags |= (skb_vlan_tag_get(skb) << IGB_TX_FLAGS_VLAN_SHIFT);
5715  }
5716 
5717  /* record initial flags and protocol */
5718  first->tx_flags = tx_flags;
5719  first->protocol = protocol;
5720 
5721  tso = igb_tso(tx_ring, first, &hdr_len);
5722  if (tso < 0)
5723  goto out_drop;
5724  else if (!tso)
5725  igb_tx_csum(tx_ring, first);
5726 
5727  igb_tx_map(tx_ring, first, hdr_len);
5728 
5729 #ifndef HAVE_TRANS_START_IN_QUEUE
5730  netdev_ring(tx_ring)->trans_start = jiffies;
5731 
5732 #endif
5733  /* Make sure there is space in the ring for the next send. */
5734  igb_maybe_stop_tx(tx_ring, DESC_NEEDED);
5735 
5736  return NETDEV_TX_OK;
5737 
5738 out_drop:
5739  igb_unmap_and_free_tx_resource(tx_ring, first);
5740 
5741  return NETDEV_TX_OK;
5742 }
struct e1000_hw hw
Definition: igb.h:594
struct sk_buff * skb
Definition: igb.h:310
static int igb_maybe_stop_tx(struct igb_ring *tx_ring, const u16 size)
Definition: igb_main.c:5643
static volatile float f
__be16 protocol
Definition: igb.h:313
static void igb_tx_csum(struct igb_ring *tx_ring, struct igb_tx_buffer *first)
Definition: igb_main.c:5363
#define netdev_ring(ring)
Definition: igb.h:469
struct e1000_mac_info mac
Definition: e1000_hw.h:762
u16 next_to_use
Definition: igb.h:385
enum e1000_mac_type type
Definition: e1000_hw.h:602
u_int16_t u16
Definition: e1000_osdep.h:51
#define IGB_TX_FLAGS_VLAN_SHIFT
Definition: igb.h:286
unsigned int bytecount
Definition: igb.h:311
unsigned long state
Definition: igb.h:537
struct net_device * netdev
Definition: igb.h:367
u32 tx_flags
Definition: igb.h:317
u_int8_t u8
Definition: e1000_osdep.h:52
struct igb_tx_buffer * tx_buffer_info
Definition: igb.h:370
u16 gso_segs
Definition: igb.h:312
static void igb_tx_map(struct igb_ring *tx_ring, struct igb_tx_buffer *first, const u8 hdr_len)
Definition: igb_main.c:5483
#define DESC_NEEDED
Definition: igb.h:298
#define unlikely(_x)
Definition: kcompat.h:254
static int igb_tso(struct igb_ring *tx_ring, struct igb_tx_buffer *first, u8 *hdr_len)
Definition: igb_main.c:5289
u_int32_t u32
Definition: e1000_osdep.h:50
void igb_unmap_and_free_tx_resource(struct igb_ring *ring, struct igb_tx_buffer *tx_buffer)
Definition: igb_main.c:4172
#define TXD_USE_COUNT(S)
Definition: igb.h:296

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 함수를 호출하는 함수들에 대한 그래프입니다.:

MODULE_AUTHOR ( "Intel  Corporation,
< e1000-devel @lists.sourceforge.net >"   
)
MODULE_DESCRIPTION ( "Intel(R) Gigabit Ethernet Network Driver"  )
MODULE_DEVICE_TABLE ( pci  ,
igb_pci_tbl   
)
module_exit ( igb_exit_module  )

이 함수를 호출하는 함수들에 대한 그래프입니다.:

module_init ( igb_init_module  )

이 함수를 호출하는 함수들에 대한 그래프입니다.:

MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
 
)
module_param ( tx_size  ,
int  ,
 
)
MODULE_PARM_DESC ( debug  ,
"Debug level (0=none, ..., 16=all)"   
)
MODULE_PARM_DESC ( tx_size  ,
"Tx Ring size passed in insmod parameter"   
)
MODULE_VERSION ( DRV_VERSION  )

변수 문서화

int debug = NETIF_MSG_DRV | NETIF_MSG_PROBE
static

igb_main.c 파일의 377 번째 라인에서 정의되었습니다.

const char igb_copyright[]
static
초기값:
=
"Copyright (c) 2007-2015 Intel Corporation."

igb_main.c 파일의 91 번째 라인에서 정의되었습니다.

struct pci_driver igb_driver
static
초기값:
= {
.name = igb_driver_name,
.id_table = igb_pci_tbl,
.probe = igb_probe,
.remove = __devexit_p(igb_remove),
.shutdown = igb_shutdown,
.err_handler = &igb_err_handler
}
static void igb_remove(struct pci_dev *pdev)
Definition: igb_main.c:3175
#define __devexit_p
Definition: kcompat.h:4085
static const struct pci_device_id igb_pci_tbl[]
Definition: igb_main.c:94
static struct pci_error_handlers igb_err_handler
Definition: igb_main.c:291
static void igb_shutdown(struct pci_dev *)
Definition: igb_main.c:9466
char igb_driver_name[]
Definition: igb_main.c:87
static int igb_probe(struct pci_dev *, const struct pci_device_id *)
Definition: igb_main.c:2627

igb_main.c 파일의 322 번째 라인에서 정의되었습니다.

char igb_driver_name[] = "igb_avb"

igb_main.c 파일의 87 번째 라인에서 정의되었습니다.

const char igb_driver_string[]
static
초기값:
=
"Intel(R) Gigabit Ethernet Network Driver"

igb_main.c 파일의 89 번째 라인에서 정의되었습니다.

char igb_driver_version[] = DRV_VERSION

igb_main.c 파일의 88 번째 라인에서 정의되었습니다.

struct pci_error_handlers igb_err_handler
static
초기값:
= {
.error_detected = igb_io_error_detected,
.slot_reset = igb_io_slot_reset,
.resume = igb_io_resume,
}
static pci_ers_result_t igb_io_error_detected(struct pci_dev *, pci_channel_state_t)
Definition: igb_main.c:9513
static void igb_io_resume(struct pci_dev *)
Definition: igb_main.c:9652
static pci_ers_result_t igb_io_slot_reset(struct pci_dev *)
Definition: igb_main.c:9615

igb_main.c 파일의 291 번째 라인에서 정의되었습니다.

struct file_operations igb_fops
static
초기값:
= {
.owner = THIS_MODULE,
.llseek = no_llseek,
.read = igb_read,
.write = igb_write,
.poll = igb_pollfd,
.open = igb_open_file,
.release = igb_close_file,
.mmap = igb_mmap,
.unlocked_ioctl = igb_ioctl_file,
}
static int igb_open_file(struct inode *inode, struct file *file)
Definition: igb_main.c:10757
static int igb_mmap(struct file *file, struct vm_area_struct *vma)
Definition: igb_main.c:10845
static unsigned int igb_pollfd(struct file *file, poll_table *wait)
Definition: igb_main.c:10212
static int igb_close_file(struct inode *inode, struct file *file)
Definition: igb_main.c:10776
static ssize_t igb_write(struct file *file, const char __user *buf, size_t count, loff_t *pos)
Definition: igb_main.c:10223
static ssize_t igb_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
Definition: igb_main.c:10217
static long igb_ioctl_file(struct file *file, unsigned int cmd, unsigned long arg)
Definition: igb_main.c:10715

igb_main.c 파일의 301 번째 라인에서 정의되었습니다.

struct miscdevice igb_miscdev
static
초기값:
= {
.minor = MISC_DYNAMIC_MINOR,
.name = "igb_avb",
.fops = &igb_fops,
}
static struct file_operations igb_fops
Definition: igb_main.c:301

igb_main.c 파일의 316 번째 라인에서 정의되었습니다.

struct vm_operations_struct igb_mmap_ops
static
초기값:
= {
.open = igb_vm_open,
.close = igb_vm_close,
.fault = igb_vm_fault
}
static void igb_vm_close(struct vm_area_struct *vma)
Definition: igb_main.c:10833
static int igb_vm_fault(struct vm_fault *fdata)
Definition: igb_main.c:10837
static void igb_vm_open(struct vm_area_struct *vma)
Definition: igb_main.c:10829

igb_main.c 파일의 236 번째 라인에서 정의되었습니다.

const struct net_device_ops igb_netdev_ops
static

igb_main.c 파일의 2356 번째 라인에서 정의되었습니다.

const struct pci_device_id igb_pci_tbl[]
static
초기값:
= {
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_COPPER) },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_FIBER) },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_SERDES) },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_SGMII) },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_AUTOMOTIVE) },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_COPPER_FLASHLESS) },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_SERDES_FLASHLESS) },
{0, }
}
#define E1000_DEV_ID_I210_FIBER
Definition: e1000_hw.h:59
#define E1000_DEV_ID_I210_SERDES
Definition: e1000_hw.h:60
#define E1000_DEV_ID_I210_SERDES_FLASHLESS
Definition: e1000_hw.h:64
#define E1000_DEV_ID_I210_COPPER
Definition: e1000_hw.h:56
#define E1000_DEV_ID_I210_COPPER_FLASHLESS
Definition: e1000_hw.h:63
#define E1000_DEV_ID_I210_AUTOMOTIVE
Definition: e1000_hw.h:62
#define E1000_DEV_ID_I210_SGMII
Definition: e1000_hw.h:61

igb_main.c 파일의 94 번째 라인에서 정의되었습니다.

int tx_size = 256
static

igb_main.c 파일의 382 번째 라인에서 정의되었습니다.